helly Mon Nov 4 08:39:18 2002 EDT
Modified files:
/php4/ext/dba dba_db2.c dba_db3.c dba_dbm.c dba_gdbm.c
Log:
use ecmalloc/efree functions instead of (c|m)alloc/free
Index: php4/ext/dba/dba_db2.c
diff -u php4/ext/dba/dba_db2.c:1.27 php4/ext/dba/dba_db2.c:1.28
--- php4/ext/dba/dba_db2.c:1.27 Mon Nov 4 07:27:13 2002
+++ php4/ext/dba/dba_db2.c Mon Nov 4 08:39:17 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_db2.c,v 1.27 2002/11/04 12:27:13 helly Exp $ */
+/* $Id: dba_db2.c,v 1.28 2002/11/04 13:39:17 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -75,7 +75,7 @@
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 @@
if (dba->cursor)
dba->cursor->c_close(dba->cursor);
dba->dbp->close(dba->dbp, 0);
- free(dba);
+ efree(dba);
}
DBA_FETCH_FUNC(db2)
Index: php4/ext/dba/dba_db3.c
diff -u php4/ext/dba/dba_db3.c:1.18 php4/ext/dba/dba_db3.c:1.19
--- php4/ext/dba/dba_db3.c:1.18 Mon Nov 4 07:27:13 2002
+++ php4/ext/dba/dba_db3.c Mon Nov 4 08:39:17 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_db3.c,v 1.18 2002/11/04 12:27:13 helly Exp $ */
+/* $Id: dba_db3.c,v 1.19 2002/11/04 13:39:17 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -77,7 +77,7 @@
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 @@
if (dba->cursor) dba->cursor->c_close(dba->cursor);
dba->dbp->close(dba->dbp, 0);
- free(dba);
+ efree(dba);
}
DBA_FETCH_FUNC(db3)
Index: php4/ext/dba/dba_dbm.c
diff -u php4/ext/dba/dba_dbm.c:1.15 php4/ext/dba/dba_dbm.c:1.16
--- php4/ext/dba/dba_dbm.c:1.15 Thu Apr 18 08:30:18 2002
+++ php4/ext/dba/dba_dbm.c Mon Nov 4 08:39:17 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_dbm.c,v 1.15 2002/04/18 12:30:18 derick Exp $ */
+/* $Id: dba_dbm.c,v 1.16 2002/11/04 13:39:17 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -78,13 +78,13 @@
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: php4/ext/dba/dba_gdbm.c
diff -u php4/ext/dba/dba_gdbm.c:1.11 php4/ext/dba/dba_gdbm.c:1.12
--- php4/ext/dba/dba_gdbm.c:1.11 Thu Apr 18 08:30:18 2002
+++ php4/ext/dba/dba_gdbm.c Mon Nov 4 08:39:17 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_gdbm.c,v 1.11 2002/04/18 12:30:18 derick Exp $ */
+/* $Id: dba_gdbm.c,v 1.12 2002/11/04 13:39:17 helly Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -59,8 +59,7 @@
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 @@
if(dba->nextkey.dptr) free(dba->nextkey.dptr);
gdbm_close(dba->dbf);
- free(dba);
+ efree(dba);
}
DBA_FETCH_FUNC(gdbm)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php