From d30ba9a6e085d8fe845f394737827fe5ef7c0565 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sun, 1 Sep 2002 04:47:03 +0000 Subject: [PATCH] Don't call nffreeall, in any of the c/c++ programs. It appears dselect slightly corrupts it's memory enough that it can't be freed without segfaulting. --- ChangeLog | 7 +++++++ debian/changelog | 4 ++++ dpkg-deb/main.c | 2 +- dselect/main.cc | 2 +- include/dpkg.h.in | 2 +- lib/startup.c | 5 +++-- main/main.c | 2 +- main/query.c | 2 +- split/main.c | 2 +- 9 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ba386db..4af9ce1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Aug 31 23:46:04 CDT 2002 Adam Heath + + * dpkg-deb/main.c, dselect/main.cc, include/dpkg.h.in, lib/startup.c + main/main.c, main/query.c, split/main.c: Don't call nffreeall, in any + of the c/c++ programs. It appears dselect slightly corrupts it's + memory enough that it can't be freed without segfaulting. + Sat Aug 31 23:42:08 CDT 2002 Adam Heath * version-nr, debian/changelog: Modified for version 1.10.6. diff --git a/debian/changelog b/debian/changelog index 16069e8c..ea842d8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,9 @@ dpkg (1.10.6) unstable; urgency=low + * Don't call nffreeall, in any of the c/c++ programs. It appears dselect + slightly corrupts it's memory enough that it can't be freed without + segfaulting. Closes: #159023. + -- Adam Heath UNRELEASED dpkg (1.10.5) unstable; urgency=low diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index 54b10618..dad11cb9 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -170,7 +170,7 @@ int main(int argc, const char *const *argv) { unsetenv("GZIP"); action(argv); - standard_shutdown(); + standard_shutdown(0); exit(0); } diff --git a/dselect/main.cc b/dselect/main.cc index 831bfef9..4dfc329a 100644 --- a/dselect/main.cc +++ b/dselect/main.cc @@ -494,7 +494,7 @@ int main(int, const char *const *argv) { } cursesoff(); - standard_shutdown(); + standard_shutdown(0); return(0); } diff --git a/include/dpkg.h.in b/include/dpkg.h.in index 06c4074d..f43d04c6 100644 --- a/include/dpkg.h.in +++ b/include/dpkg.h.in @@ -168,7 +168,7 @@ extern const char printforhelp[]; /*** from startup.c ***/ void standard_startup(jmp_buf *ejbuf, int argc, const char *const **argv, const char *prog, int loadcfg, const struct cmdinfo cmdinfos[]); -void standard_shutdown(void); +void standard_shutdown(int freemem); /*** from ehandle.c ***/ diff --git a/lib/startup.c b/lib/startup.c index a669af54..1458ca3d 100644 --- a/lib/startup.c +++ b/lib/startup.c @@ -57,8 +57,9 @@ void standard_startup(jmp_buf *ejbuf, int argc, const char *const **argv, const myopt(argv,cmdinfos); } -void standard_shutdown(void) { +void standard_shutdown(int freemem) { set_error_display(0,0); error_unwind(ehflag_normaltidy); - nffreeall(); + if (freemem) + nffreeall(); } diff --git a/main/main.c b/main/main.c index 8e8ef122..a58154c6 100644 --- a/main/main.c +++ b/main/main.c @@ -558,7 +558,7 @@ int main(int argc, const char *const *argv) { actionfunction(argv); - standard_shutdown(); + standard_shutdown(0); return reportbroken_retexitstatus(); } diff --git a/main/query.c b/main/query.c index 2ff4a57d..c3f69a1e 100644 --- a/main/query.c +++ b/main/query.c @@ -547,7 +547,7 @@ int main(int argc, const char *const *argv) { actionfunction(argv); - standard_shutdown(); + standard_shutdown(0); return reportbroken_retexitstatus(); } diff --git a/split/main.c b/split/main.c index 0f9d77b0..4ab3c956 100644 --- a/split/main.c +++ b/split/main.c @@ -169,6 +169,6 @@ int main(int argc, const char *const *argv) { if (ferror(stderr)) werr("stderr"); - standard_shutdown(); + standard_shutdown(0); exit(0); } -- 2.39.5