aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/blogc-make/exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/blogc-make/exec.c b/src/blogc-make/exec.c
index c282a91..3e53319 100644
--- a/src/blogc-make/exec.c
+++ b/src/blogc-make/exec.c
@@ -416,7 +416,9 @@ bm_exec_blogc_get_variable(bm_ctx_t *ctx, bc_trie_t *global_variables,
return NULL;
}
- char *val = bc_strndup(out, strlen(out) - 1);
+ char *val = NULL;
+ if (out != NULL)
+ val = bc_strndup(out, strlen(out) - 1);
bc_string_free(input, true);
free(cmd);