diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-11-30 17:25:18 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-11-30 17:26:43 +0100 |
commit | d1442dee24b0760665a103c5c1b3ad838eef02f9 (patch) | |
tree | 72152914aa8a7a4e11ebd6ddac2897fd8c80f10f /qdepends.c | |
parent | tests: allow running all tests using valgrind (diff) | |
download | portage-utils-d1442dee24b0760665a103c5c1b3ad838eef02f9.tar.gz portage-utils-d1442dee24b0760665a103c5c1b3ad838eef02f9.tar.bz2 portage-utils-d1442dee24b0760665a103c5c1b3ad838eef02f9.zip |
misc fixes for valgrind
mainly memory and socket leaks, sometimes using invalid data, this is
related to bug #701402
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qdepends.c')
-rw-r--r-- | qdepends.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -345,17 +345,23 @@ int qdepends_main(int argc, char **argv) state.qmode &= ~QMODE_INSTALLED; } - if ((argc == optind) && !do_pretty) + if ((argc == optind) && !do_pretty) { + free_set(state.udeps); qdepends_usage(EXIT_FAILURE); + } if (do_pretty) { + ret = EXIT_SUCCESS; while (optind < argc) { - if (!qdepends_print_depend(stdout, argv[optind++])) - return EXIT_FAILURE; + if (!qdepends_print_depend(stdout, argv[optind++])) { + ret = EXIT_FAILURE; + break; + } if (optind < argc) fprintf(stdout, "\n"); } - return EXIT_SUCCESS; + free_set(state.udeps); + return ret; } argc -= optind; |