From 530d34eeb224ce03ca94e4c7ff4e51a429497552 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Sat, 12 Oct 2013 20:50:07 +0100 Subject: [PATCH] fix crash if storage files could not be opened. TODO give a fitting error message --- src/storage/get.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/storage/get.c b/src/storage/get.c index b254462..4020462 100644 --- a/src/storage/get.c +++ b/src/storage/get.c @@ -40,6 +40,11 @@ storageGet( datum gdbm_key = {key, nkey}; datum value; + if (NULL == this) { + *data = NULL; + *ndata = 0; + } + memcpy(key, _key, nkey); value = gdbm_fetch(this->gdbm, gdbm_key); MEM_FREE(key);