summaryrefslogtreecommitdiffstats
path: root/common/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/misc.c')
-rw-r--r--common/misc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/misc.c b/common/misc.c
index 6970ab7..920ac49 100644
--- a/common/misc.c
+++ b/common/misc.c
@@ -64,7 +64,9 @@ void *sbrk (ptrdiff_t increment)
{
void *old = sbrk_no_zero(increment);
- memset (old, 0, increment);
+ /* Only clear increment, if valid address was returned */
+ if (old != NULL)
+ memset (old, 0, increment);
return old;
}