diff --git a/daemon/blkid.c b/daemon/blkid.c index fea322f5e..5751a4d89 100644 --- a/daemon/blkid.c +++ b/daemon/blkid.c @@ -112,8 +112,10 @@ test_blkid_p_i_opt (void) } r = commandr (NULL, &err2, "blkid", "-i", NULL); - if (r == -1) - goto command_failed; + if (r == -1) { + reply_with_error ("could not run 'blkid' command: %s", err2); + return -1; + } if (strstr (err2, "invalid option --")) { return 0; diff --git a/daemon/debug.c b/daemon/debug.c index 484318f7a..da504e839 100644 --- a/daemon/debug.c +++ b/daemon/debug.c @@ -164,6 +164,7 @@ debug_fds (const char *subcmd, size_t argc, char *const *const argv) if (!dir) { reply_with_perror ("opendir: /proc/self/fd"); fclose (fp); + free (out); return NULL; } diff --git a/daemon/file.c b/daemon/file.c index 9464d3bd0..16f08f500 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -501,7 +501,10 @@ do_zfile (const char *method, const char *path) if (len > 0 && line[len-1] == '\n') line[len-1] = '\0'; - return strdup (line); + char *ret = strdup (line); + if (ret == NULL) + reply_with_perror ("strdup"); + return ret; } int64_t