git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d0fc167
)
return NULL for a zero size memdup
author
Andrew Tridgell
<tridge@samba.org>
Sat, 22 Apr 2000 08:29:41 +0000
(08:29 +0000)
committer
Andrew Tridgell
<tridge@samba.org>
Sat, 22 Apr 2000 08:29:41 +0000
(08:29 +0000)
source/lib/util.c
patch
|
blob
|
history
diff --git
a/source/lib/util.c
b/source/lib/util.c
index 2f8b52ccbde28eda156ddf124ddfac3ccb26ec45..ccdfc72bbdd6dcd71617d8f44814452360105582 100644
(file)
--- a/
source/lib/util.c
+++ b/
source/lib/util.c
@@
-2581,6
+2581,7
@@
like strdup but for memory
void *memdup(void *p, size_t size)
{
void *p2;
+ if (size == 0) return NULL;
p2 = malloc(size);
if (!p2) return NULL;
memcpy(p2, p, size);