From d26013a90f4f5bef774f18072e9526c5d66aef5e Mon Sep 17 00:00:00 2001 From: retoor <retoor@molodetz.nl> Date: Mon, 3 Mar 2025 09:52:28 +0100 Subject: [PATCH] Fixes. --- tools.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools.h b/tools.h index 14b4c58..61ebb64 100644 --- a/tools.h +++ b/tools.h @@ -41,7 +41,7 @@ char * tool_function_bash(char * command){ fp = popen(command, "r"); if (fp == NULL) { perror("popen failed"); - return "Popen failed!"; + return strdup("Popen failed!"); } // Read output in chunks @@ -52,7 +52,7 @@ char * tool_function_bash(char * command){ perror("realloc failed"); free(output); pclose(fp); - return "Failed to allocate memory!"; + return strdup("Failed to allocate memory!"); } output = new_output; strcpy(output + total_size, buffer);