The following commit has been merged in the master branch:
commit 5fc9084fd7c439bbc73a3628b513e028c984ac29
Author: Guillem Jover <[email protected]>
Date: Sun Sep 18 19:22:59 2011 +0200
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 <[email protected]>
diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c
index 6f4616e..7a2cfa4 100644
--- a/lib/dpkg/parsehelp.c
+++ b/lib/dpkg/parsehelp.c
@@ -287,6 +287,8 @@ parse_db_version(struct parsedb_state *ps, struct
versionrevision *version,
parse_warn(ps, "%s: %.250s", buf, err.str);
else
parse_error(ps, "%s: %.250s", buf, err.str);
+
+ dpkg_error_destroy(&err);
}
void
diff --git a/src/enquiry.c b/src/enquiry.c
index 9ac18f5..a237817 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);
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]