diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-12-18 14:00:49 +1100 |
---|---|---|
committer | Sam Mendoza-Jonas <sam@mendozajonas.com> | 2016-02-09 13:39:34 +1100 |
commit | 5f339d4485e450adac994c190bfafb45734bcae9 (patch) | |
tree | cc8e2656ea308b16cd2b0d41f6d54869e9c5e8cf /discover | |
parent | 90cd56cb816e7045b41542c119f64b9ee349a6bc (diff) | |
download | petitboot-5f339d4485e450adac994c190bfafb45734bcae9.zip petitboot-5f339d4485e450adac994c190bfafb45734bcae9.tar.gz |
discover: Release process resources on error
Fixes Coverity defect #30472
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'discover')
-rw-r--r-- | discover/device-handler.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c index 77f9e3c..9de2a19 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -1099,10 +1099,12 @@ static char *device_from_addr(void *ctx, struct pb_url *url) rc = process_run_sync(p); - if (rc) { + if (rc || p->exit_status) { /* ip has complained for some reason; most likely * there is no route to the host - bail out */ - pb_debug("%s: No route to %s\n",__func__,url->host); + pb_debug("%s: `ip` returns non-zero exit status\n", __func__); + pb_debug("ip buf: %s\n", p->stdout_buf); + process_release(p); return NULL; } |