From: Perl 5 Porters Date: Sat, 7 Sep 1996 23:55:22 +0000 (+0000) Subject: perl 5.003_05: ext/ODBM_File/ODBM_File.xs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1639c7b394658ecd7eb856ba9df0fd2269415ecd;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_05: ext/ODBM_File/ODBM_File.xs Attempt to correct for "Bad free" in Ultrix and HPUX versions of odbm. --- diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs index c1b405f..92b443c 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 typedef void* ODBM_File;