diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-12-28 17:54:08 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-12-28 17:54:08 -0500 |
commit | 8f6a879b16fc664b03c361ae203def52220d0cb9 (patch) | |
tree | cb541a9806018a2fa85c2a1b04727a1e98982aa0 /q.c | |
parent | start some likely/unlikely helpers (diff) | |
download | portage-utils-8f6a879b16fc664b03c361ae203def52220d0cb9.tar.gz portage-utils-8f6a879b16fc664b03c361ae203def52220d0cb9.tar.bz2 portage-utils-8f6a879b16fc664b03c361ae203def52220d0cb9.zip |
add cleanup logic to handle specific leaks
There's a few code paths that we leak resources because we know
we're exiting (soon). Add some logic to avoid false positives.
Diffstat (limited to 'q.c')
-rw-r--r-- | q.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -87,8 +87,8 @@ int q_main(int argc, char **argv) case 'm': if (optarg) { const char *path = initialize_flat(optarg, CACHE_METADATA, true); - if (path) { /* silence warning */ } - IF_DEBUG(free((void *)path)); + if (USE_CLEANUP) + free((void *)path); reinitialize_metacache = -1; } else reinitialize_metacache = 1; @@ -96,8 +96,8 @@ int q_main(int argc, char **argv) case 'r': if (optarg) { const char *path = initialize_flat(optarg, CACHE_EBUILD, true); - if (path) { /* silence warning */ } - IF_DEBUG(free((void *)path)); + if (USE_CLEANUP) + free((void *)path); reinitialize = -1; } else reinitialize = 1; |