summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbm/src/nsres.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/dbm/src/nsres.c b/dbm/src/nsres.c
index e383d58e5..4b4dae4a2 100644
--- a/dbm/src/nsres.c
+++ b/dbm/src/nsres.c
@@ -79,8 +79,7 @@ NSRESHANDLE NSResCreateTable(const char *filename, NSRESTHREADINFO *threadinfo)
flag = O_RDWR | O_CREAT;
- hres = (RESHANDLE) malloc ( sizeof(struct RESDATABASE) );
- memset(hres, 0, sizeof(struct RESDATABASE));
+ hres = (RESHANDLE) calloc ( 1, sizeof(struct RESDATABASE) );
if (threadinfo && threadinfo->lock && threadinfo->fn_lock
&& threadinfo->fn_unlock)
@@ -111,8 +110,7 @@ NSRESHANDLE NSResOpenTable(const char *filename, NSRESTHREADINFO *threadinfo)
flag = O_RDONLY; /* only open database for reading */
- hres = (RESHANDLE) malloc ( sizeof(struct RESDATABASE) );
- memset(hres, 0, sizeof(struct RESDATABASE));
+ hres = (RESHANDLE) calloc ( 1, sizeof(struct RESDATABASE) );
if (threadinfo && threadinfo->lock && threadinfo->fn_lock
&& threadinfo->fn_unlock)