Skip to content

Commit

Permalink
Only memset if malloc returnes non-NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Dec 19, 2020
1 parent 41f01a2 commit 6b279b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/umm_malloc/umm_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ void *umm_calloc( size_t num, size_t item_size ) {

size += POISON_SIZE(size);
ret = _umm_malloc(size);
memset(ret, 0x00, size);
if (ret != NULL) memset(ret, 0x00, size);

ret = GET_POISONED(ret, size);

Expand Down

0 comments on commit 6b279b3

Please sign in to comment.