Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #198 from ldorau/test-fix-possible-null-pointer-de…
Browse files Browse the repository at this point in the history
…reference-in-test_heap_usage

test: fix possible null-pointer dereference in test_heap_usage
  • Loading branch information
marcinslusarz authored Mar 29, 2019
2 parents 0e53714 + 4fc4ac2 commit 31932c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/vmemcache_test_heap_usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ test_heap_usage(const char *dir, heap_usage *usage)

size_t key = 0;
size_t vsize = 32;

char *value = malloc(vsize);
if (value == NULL)
UT_FATAL("out of memory");
memset(value, 'a', vsize - 1);
value[vsize - 1] = '\0';

Expand Down

0 comments on commit 31932c5

Please sign in to comment.