summaryrefslogtreecommitdiff
path: root/ext/dba/dba_db2.c
diff options
context:
space:
mode:
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;
}