aboutsummaryrefslogtreecommitdiff
path: root/q.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-12-28 17:54:08 -0500
committerMike Frysinger <vapier@gentoo.org>2016-12-28 17:54:08 -0500
commit8f6a879b16fc664b03c361ae203def52220d0cb9 (patch)
treecb541a9806018a2fa85c2a1b04727a1e98982aa0 /q.c
parentstart some likely/unlikely helpers (diff)
downloadportage-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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/q.c b/q.c
index 6ee9aef3..ea1fb4d7 100644
--- a/q.c
+++ b/q.c
@@ -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;