From: Adam Heath Date: Tue, 3 Sep 2002 23:34:50 +0000 (+0000) Subject: Protect duplicate calls to obstack_free(), as obstack_free segfaults when X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5e8288468134ac71b0357a58ded20b883607081;p=dpkg Protect duplicate calls to obstack_free(), as obstack_free segfaults when called without initializing. --- diff --git a/ChangeLog b/ChangeLog index 85189528..06dcb94f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Sep 3 18:37:45 CDT 2002 Adam Heath + + * lib/nfmalloc.c: Protect duplicate calls to obstack_free(), + as obstack_free segfaults when called without initializing. + Tue Sep 3 18:36:42 CDT 2002 Adam Heath * version-nr, debian/changelog: Set 1.10.7 version. diff --git a/lib/nfmalloc.c b/lib/nfmalloc.c index 2930b883..f44d08c8 100644 --- a/lib/nfmalloc.c +++ b/lib/nfmalloc.c @@ -62,6 +62,8 @@ char *nfstrnsave(const char *string, int l) { } void nffreeall(void) { - obstack_free(&db_obs, NULL); - dbobs_init = 0; + if (dbobs_init) { + obstack_free(&db_obs, NULL); + dbobs_init = 0; + } }