summaryrefslogtreecommitdiff
path: root/lib/ntdb/tools/growtdb-bench.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ntdb/tools/growtdb-bench.c')
-rw-r--r--lib/ntdb/tools/growtdb-bench.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/ntdb/tools/growtdb-bench.c b/lib/ntdb/tools/growtdb-bench.c
index 640f87af5a..aa5a406a54 100644
--- a/lib/ntdb/tools/growtdb-bench.c
+++ b/lib/ntdb/tools/growtdb-bench.c
@@ -48,12 +48,24 @@ int main(int argc, char *argv[])
idxkey.dsize = strlen("User index");
idxdata.dsize = 51;
idxdata.dptr = calloc(idxdata.dsize, 1);
+ if (idxdata.dptr == NULL) {
+ fprintf(stderr, "Unable to allocate memory for idxdata.dptr\n");
+ return -1;
+ }
/* Create users. */
k.dsize = 48;
k.dptr = calloc(k.dsize, 1);
+ if (k.dptr == NULL) {
+ fprintf(stderr, "Unable to allocate memory for k.dptr\n");
+ return -1;
+ }
d.dsize = 64;
d.dptr = calloc(d.dsize, 1);
+ if (d.dptr == NULL) {
+ fprintf(stderr, "Unable to allocate memory for d.dptr\n");
+ return -1;
+ }
ntdb_transaction_start(ntdb);
for (i = 0; i < users; i++) {
@@ -79,6 +91,10 @@ int main(int argc, char *argv[])
* a group. */
gk.dsize = 48;
gk.dptr = calloc(k.dsize, 1);
+ if (gk.dptr == NULL) {
+ fprintf(stderr, "Unable to allocate memory for gk.dptr\n");
+ return -1;
+ }
gk.dptr[gk.dsize-1] = 1;
d.dsize = 32;