Permalink
Browse files

Assign default malloc/realloc/free if none provided. Fixes multiple r…

…uns inside gbd, and test cases.
  • Loading branch information...
1 parent 9f829e2 commit 6917d157393ac32c85f73761c3cfc78f37a3d334 @ZeroStride ZeroStride committed Oct 25, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/ekvs.c
View
@@ -46,6 +46,12 @@ int ekvs_open(ekvs* store, const char* path, const ekvs_opts* opts)
ekvs_realloc = opts->user_realloc;
ekvs_free = opts->user_free;
}
+ else
+ {
+ ekvs_malloc = malloc;
+ ekvs_realloc = realloc;
+ ekvs_free = free;
+ }
/* Allocate structure */
*store = ekvs_malloc(sizeof(struct _ekvs_db));

0 comments on commit 6917d15

Please sign in to comment.