summaryrefslogtreecommitdiff
path: root/c_src
diff options
context:
space:
mode:
Diffstat (limited to 'c_src')
-rw-r--r--c_src/permdb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/c_src/permdb.c b/c_src/permdb.c
index 7ad9c61..b3e17b6 100644
--- a/c_src/permdb.c
+++ b/c_src/permdb.c
@@ -433,6 +433,10 @@ permdb_alloc(const char *dbpath)
}
permdb_object *state = malloc(sizeof(permdb_object));
+ if (state == NULL) {
+ return NULL;
+ }
+
state->datafile = bf_open(dbpath, O_RDWR|O_CREAT, "datafile");
state->indexfile = bf_open(idxpath, O_RDWR|O_CREAT, "indexfile");