From: Havard Graff Date: Tue, 24 Apr 2018 20:05:42 +0000 (+0200) Subject: hashutil: fix memory-leak/double free X-Git-Tag: v3.5~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37a54631e4b3cf1596c52201554d7d52c3bd7acf;p=thirdparty%2Fccache.git hashutil: fix memory-leak/double free --- diff --git a/src/hashutil.c b/src/hashutil.c index ddbd0daa7..0086bf7fd 100644 --- a/src/hashutil.c +++ b/src/hashutil.c @@ -220,7 +220,7 @@ hash_command_output(struct mdfour *hash, const char *command, CloseHandle(pipe_out[1]); args_free(args); free(win32args); - if (cmd) { + if (!cmd) { free((char *)command); // Original argument was replaced above. } if (ret == 0) {