summaryrefslogtreecommitdiff
path: root/ext/dba/dba_db2.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-11-05 14:46:36 +0000
committerMarcus Boerger <helly@php.net>2002-11-05 14:46:36 +0000
commit177b24a44ee3b0ff39889a1ef1f896edf559a389 (patch)
treea72933d329f02221d61f564caa9c4423e7cb6a5f /ext/dba/dba_db2.c
parent41a77bccba8f597d694f5b66b289f1bba6529a26 (diff)
downloadphp-git-177b24a44ee3b0ff39889a1ef1f896edf559a389.tar.gz
Why did open fail?
Diffstat (limited to 'ext/dba/dba_db2.c')
-rw-r--r--ext/dba/dba_db2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c
index 5b628c98f6..eb6942f84a 100644
--- a/ext/dba/dba_db2.c
+++ b/ext/dba/dba_db2.c
@@ -63,8 +63,9 @@ DBA_OPEN_FUNC(db2)
info->mode == DBA_WRITER ? 0 :
info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1;
- if (gmode == -1)
- return FAILURE;
+ if (gmode == -1) {
+ return FAILURE;/* not possible */
+ }
if (info->argc > 0) {
convert_to_long_ex(info->argv[0]);
@@ -76,6 +77,10 @@ DBA_OPEN_FUNC(db2)
}
info->dbf = ecalloc(sizeof(dba_db2_data), 1);
+ if (!info->dbf) {
+ *error = "Out of memory";
+ return FAILURE;
+ }
((dba_db2_data *) info->dbf)->dbp = dbp;
return SUCCESS;
}