fix leaks in *DBM_File; safemalloc()ed things need to be freed with
Gurusamy Sarathy [Tue, 15 Feb 2000 05:17:56 +0000 (05:17 +0000)]
safefree() rather than Safefree()

p4raw-id: //depot/perl@5091

ext/DB_File/DB_File.xs
ext/GDBM_File/GDBM_File.xs
ext/NDBM_File/NDBM_File.xs
ext/ODBM_File/ODBM_File.xs
ext/SDBM_File/SDBM_File.xs

index 7bc2491..2b76bab 100644 (file)
@@ -1586,7 +1586,7 @@ db_DESTROY(db)
          if (db->filter_store_value)
            SvREFCNT_dec(db->filter_store_value) ;
 #endif /* DBM_FILTERING */
-         Safefree(db) ;
+         safefree(db) ;
 #ifdef DB_VERSION_MAJOR
          if (RETVAL > 0)
            RETVAL = -1 ;
index be1817b..870f056 100644 (file)
@@ -236,6 +236,7 @@ gdbm_DESTROY(db)
        GDBM_File       db
        CODE:
        gdbm_close(db);
+       safefree(db);
 
 #define gdbm_FETCH(db,key)                     gdbm_fetch(db->dbp,key)
 datum_value
index 29cc288..49a1db5 100644 (file)
@@ -63,6 +63,7 @@ ndbm_DESTROY(db)
        NDBM_File       db
        CODE:
        dbm_close(db->dbp);
+       safefree(db);
 
 #define ndbm_FETCH(db,key)                     dbm_fetch(db->dbp,key)
 datum_value
index 7601c34..e263dfb 100644 (file)
@@ -120,6 +120,7 @@ DESTROY(db)
        CODE:
        dbmrefcnt--;
        dbmclose();
+       safefree(db);
 
 datum_value
 odbm_FETCH(db, key)
index ee672ca..a4b9045 100644 (file)
@@ -80,7 +80,7 @@ sdbm_DESTROY(db)
            SvREFCNT_dec(db->filter_fetch_value) ;
          if (db->filter_store_value)
            SvREFCNT_dec(db->filter_store_value) ;
-         Safefree(db) ;        
+         safefree(db) ;
 
 datum_value
 sdbm_FETCH(db, key)