projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
mtd: sf: Make sf_mtd.c more robust
[platform/kernel/u-boot.git]
/
common
/
malloc_simple.c
diff --git
a/common/malloc_simple.c
b/common/malloc_simple.c
index
c14f8b5
..
871b544
100644
(file)
--- a/
common/malloc_simple.c
+++ b/
common/malloc_simple.c
@@
-57,7
+57,8
@@
void *calloc(size_t nmemb, size_t elem_size)
void *ptr;
ptr = malloc(size);
- memset(ptr, '\0', size);
+ if (ptr)
+ memset(ptr, '\0', size);
return ptr;
}