ソースを参照

Protect duplicate calls to obstack_free(), as obstack_free segfaults when
called without initializing.

Adam Heath 24 年 前
コミット
a5e8288468
共有2 個のファイルを変更した9 個の追加2 個の削除を含む
  1. 5 0
      ChangeLog
  2. 4 2
      lib/nfmalloc.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Tue Sep  3 18:37:45 CDT 2002 Adam Heath <doogie@debian.org>
+
+  * 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 <doogie@debian.org>
 
   * version-nr, debian/changelog: Set 1.10.7 version.

+ 4 - 2
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;
+  }
 }