]> granicus.if.org Git - php/commitdiff
correct errors
authorMarcus Boerger <helly@php.net>
Tue, 5 Nov 2002 19:38:06 +0000 (19:38 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 5 Nov 2002 19:38:06 +0000 (19:38 +0000)
ext/dba/dba_gdbm.c

index 49cf088f7838462acc0762d32ffb899459349937..9343685d3bb0b70308106718ec46d420d97f7ad9 100644 (file)
@@ -60,10 +60,15 @@ DBA_OPEN_FUNC(gdbm)
        
        if(dbf) {
                info->dbf = ecalloc(sizeof(dba_gdbm_data), 1);
+               if (!info->dbf) {
+                       *error = "Out of memory";
+                       gdbm_close(dbf);
+                       return FAILURE;
+               }
                ((dba_gdbm_data *) info->dbf)->dbf = dbf;
                return SUCCESS;
        }
-       *error = "Out of memory";
+       *error = gdbm_strerror(gdbm_errno);
        return FAILURE;
 }