From 133f67479b0d6d149ebe7187ac39928364e2afdd Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 10 Apr 2024 09:25:58 -0400 Subject: Fix realloc handler --- src/system.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/system.c') diff --git a/src/system.c b/src/system.c index 1701523..ca2da97 100644 --- a/src/system.c +++ b/src/system.c @@ -161,8 +161,7 @@ char *shell_output(const char *command, int *status) { char *tmp = realloc(result, sizeof(*result) * current_size); if (!tmp) { return NULL; - } - if (tmp != result) { + } else if (tmp != result) { result = tmp; } } -- cgit