aboutsummaryrefslogtreecommitdiff
path: root/src/system.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-04-10 09:25:58 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-04-10 09:25:58 -0400
commit133f67479b0d6d149ebe7187ac39928364e2afdd (patch)
tree7f785fc18b21c01783be0d89527bfe46c107c2e6 /src/system.c
parent645e2a5371057ff902ef6be089b941132dc34281 (diff)
downloadstasis-133f67479b0d6d149ebe7187ac39928364e2afdd.tar.gz
Fix realloc handler
Diffstat (limited to 'src/system.c')
-rw-r--r--src/system.c3
1 files changed, 1 insertions, 2 deletions
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;
}
}