summaryrefslogtreecommitdiff
path: root/ext/ODBM_File
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-09-07 23:55:22 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-09-07 23:55:22 +0000
commit1639c7b394658ecd7eb856ba9df0fd2269415ecd (patch)
treeeec98edf94b3157925a2c4e97a71fc5ee96a7d3f /ext/ODBM_File
parent2c891ab9c8edfc8e2047084edbe1f65cc4d305b8 (diff)
downloadperl-1639c7b394658ecd7eb856ba9df0fd2269415ecd.tar.gz
perl 5.003_05: ext/ODBM_File/ODBM_File.xs
Attempt to correct for "Bad free" in Ultrix and HPUX versions of odbm.
Diffstat (limited to 'ext/ODBM_File')
-rw-r--r--ext/ODBM_File/ODBM_File.xs15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
index c1b405ff89..92b443ce99 100644
--- a/ext/ODBM_File/ODBM_File.xs
+++ b/ext/ODBM_File/ODBM_File.xs
@@ -13,6 +13,21 @@
# endif
#endif
+#ifdef DBM_BUG_DUPLICATE_FREE
+/*
+ * DBM on at least Ultrix and HPUX call dbmclose() from dbminit(),
+ * resulting in duplicate free() because dbmclose() does *not*
+ * check if it has already been called for this DBM.
+ * If some malloc/free calls have been done between dbmclose() and
+ * the next dbminit(), the memory might be used for something else when
+ * it is freed.
+ * Verified to work on ultrix4.3. Probably will work on HP/UX.
+ * Set DBM_BUG_DUPLICATE_FREE in the extension hint file.
+ */
+/* Close the previous dbm, and fail to open a new dbm */
+#define dbmclose() ((void) dbminit("/tmp/x/y/z/z/y"))
+#endif
+
#include <fcntl.h>
typedef void* ODBM_File;