aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-07-15 22:43:08 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-07-15 22:43:08 +0200
commit533ad336eeb6636565198ac2212e2a652b3dd8c4 (patch)
treecfc3ff19efe9dca98bd57820468ac1dee92f894f /src
parentf25cef814207684104ec2b39ea1b3976118fbc14 (diff)
downloadblogc-533ad336eeb6636565198ac2212e2a652b3dd8c4.tar.gz
blogc-533ad336eeb6636565198ac2212e2a652b3dd8c4.tar.bz2
blogc-533ad336eeb6636565198ac2212e2a652b3dd8c4.zip
make: exec: trying to fix bug detected by clang-analyzer
Diffstat (limited to 'src')
-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);