diff options
Diffstat (limited to 'src/client.c')
-rw-r--r-- | src/client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client.c b/src/client.c index 4876f78..0d898d7 100644 --- a/src/client.c +++ b/src/client.c @@ -172,7 +172,7 @@ static int og_resp_probe(struct og_client *cli, json_t *data) static int og_resp_shell_run(struct og_client *cli, json_t *data) { const char *cmd = NULL, *output = NULL; - uint32_t retcode; + uint32_t retcode = 0; const char *key; json_t *value; int err = -1; @@ -197,7 +197,7 @@ static int og_resp_shell_run(struct og_client *cli, json_t *data) } - if (!output) { + if (!cmd || !output) { syslog(LOG_ERR, "%s:%d: malformed json response\n", __FILE__, __LINE__); return -1; |