Skip to content
Snippets Groups Projects
Commit c1068bb2 authored by Guillem Jover's avatar Guillem Jover
Browse files

dpkg: Fix short-lived memory leak in --force-help output


Based-on-patch-by: default avatarKOLANICH <kolan_n@mail.ru>
Warned-by: gcc ASAN
parent 60dba33b
No related branches found
No related tags found
1 merge request!3Update to 1.20.9pureos1
......@@ -758,6 +758,7 @@ commandfd(const char *const *argv)
}
int main(int argc, const char *const *argv) {
char *force_string;
int ret;
dpkg_locales_init(PACKAGE);
......@@ -781,8 +782,10 @@ int main(int argc, const char *const *argv) {
ohshite(_("unable to setenv for subprocesses"));
if (setenv("DPKG_ROOT", instdir, 1) < 0)
ohshite(_("unable to setenv for subprocesses"));
if (setenv("DPKG_FORCE", get_force_string(), 1) < 0)
force_string = get_force_string();
if (setenv("DPKG_FORCE", force_string, 1) < 0)
ohshite(_("unable to setenv for subprocesses"));
free(force_string);
if (!f_triggers)
f_triggers = (cipaction->arg_int == act_triggers && *argv) ? -1 : 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment