summaryrefslogtreecommitdiff
path: root/src/enquiry.c
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2011-09-18 19:22:59 +0200
committerGuillem Jover <guillem@debian.org>2011-09-18 19:36:26 +0200
commit5fc9084fd7c439bbc73a3628b513e028c984ac29 (patch)
tree7b4f2a34e2846bbf5eeb3cc8cef03f264672e42b /src/enquiry.c
parente2f95d8abee9978f480c8e1e4a31ed420900509c (diff)
downloaddpkg-5fc9084fd7c439bbc73a3628b513e028c984ac29.tar.gz
dpkg: Destroy the dpkg_error variables on warnings
The leak on cmpversions() does not pose any issue on normal operation as the program will exit immediately and the memory will be freed by the system, but once --command-fd is enabled, it could actually be a problem due to a long running dpkg process leaking repeatedly. The leak on parse_db_version() is actually problematic as it can act repeatedly if there's tons of warnings when parsing. Regression introduced in commit ccc26399f2f0e295da1206c5ce81fe81a5dc0e21. Reported-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'src/enquiry.c')
-rw-r--r--src/enquiry.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/enquiry.c b/src/enquiry.c
index 9ac18f516..a237817ab 100644
--- a/src/enquiry.c
+++ b/src/enquiry.c
@@ -529,6 +529,7 @@ cmpversions(const char *const *argv)
warning(_("version '%s' has bad syntax: %s"), argv[0], err.str);
else
ohshit(_("version '%s' has bad syntax: %s"), argv[0], err.str);
+ dpkg_error_destroy(&err);
}
} else {
blankversion(&a);
@@ -539,6 +540,7 @@ cmpversions(const char *const *argv)
warning(_("version '%s' has bad syntax: %s"), argv[2], err.str);
else
ohshit(_("version '%s' has bad syntax: %s"), argv[2], err.str);
+ dpkg_error_destroy(&err);
}
} else {
blankversion(&b);