]> granicus.if.org Git - php/commitdiff
use ecmalloc/efree functions instead of (c|m)alloc/free
authorMarcus Boerger <helly@php.net>
Mon, 4 Nov 2002 13:39:17 +0000 (13:39 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 4 Nov 2002 13:39:17 +0000 (13:39 +0000)
ext/dba/dba_db2.c
ext/dba/dba_db3.c
ext/dba/dba_dbm.c
ext/dba/dba_gdbm.c

index 7b5d0bcf38ababe4ce0b01705928ed22ea8fd75e..5b628c98f60ab21c7c7b86855f7479c1d952c050 100644 (file)
@@ -75,7 +75,7 @@ DBA_OPEN_FUNC(db2)
                return FAILURE;
        }
 
-       info->dbf = calloc(sizeof(dba_db2_data), 1);
+       info->dbf = ecalloc(sizeof(dba_db2_data), 1);
        ((dba_db2_data *) info->dbf)->dbp = dbp;
        return SUCCESS;
 }
@@ -87,7 +87,7 @@ DBA_CLOSE_FUNC(db2)
        if (dba->cursor) 
                dba->cursor->c_close(dba->cursor);
        dba->dbp->close(dba->dbp, 0);
-       free(dba);
+       efree(dba);
 }
 
 DBA_FETCH_FUNC(db2)
index e31fb39a0f081f4bfe36d98c3d3cb366ce17a528..edade520423420cda8bbf24409437f5dec72c978 100644 (file)
@@ -77,7 +77,7 @@ DBA_OPEN_FUNC(db3)
                        dbp->open(dbp, info->path, NULL, type, gmode, filemode) == 0) {
                dba_db3_data *data;
 
-               data = malloc(sizeof(*data));
+               data = emalloc(sizeof(*data));
                data->dbp = dbp;
                data->cursor = NULL;
                info->dbf = data;
@@ -96,7 +96,7 @@ DBA_CLOSE_FUNC(db3)
        
        if (dba->cursor) dba->cursor->c_close(dba->cursor);
        dba->dbp->close(dba->dbp, 0);
-       free(dba);
+       efree(dba);
 }
 
 DBA_FETCH_FUNC(db3)
index 8ce0b1d39708d723c7c0c8192929edbec4ada846..0eea524ccb179615c91d23c179577841200441e9 100644 (file)
@@ -78,13 +78,13 @@ DBA_OPEN_FUNC(dbm)
                return FAILURE;
        }
 
-       info->dbf = calloc(sizeof(dba_dbm_data), 1);
+       info->dbf = ecalloc(sizeof(dba_dbm_data), 1);
        return SUCCESS;
 }
 
 DBA_CLOSE_FUNC(dbm)
 {
-       free(info->dbf);
+       efree(info->dbf);
        dbmclose();
 }
 
index 66a6bce7099a8281b35ea7c393dda19197603fdd..e462d01b95bd42de3405d594da22a8df220631f9 100644 (file)
@@ -59,8 +59,7 @@ DBA_OPEN_FUNC(gdbm)
        dbf = gdbm_open(info->path, 0, gmode, filemode, NULL);
        
        if(dbf) {
-               info->dbf = malloc(sizeof(dba_gdbm_data));
-               memset(info->dbf, 0, sizeof(dba_gdbm_data));
+               info->dbf = ecalloc(sizeof(dba_gdbm_data), 1);
                ((dba_gdbm_data *) info->dbf)->dbf = dbf;
                return SUCCESS;
        }
@@ -73,7 +72,7 @@ DBA_CLOSE_FUNC(gdbm)
        
        if(dba->nextkey.dptr) free(dba->nextkey.dptr);
        gdbm_close(dba->dbf);
-       free(dba);
+       efree(dba);
 }
 
 DBA_FETCH_FUNC(gdbm)