summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-04-22 08:29:41 +0000
committerAndrew Tridgell <tridge@samba.org>2000-04-22 08:29:41 +0000
commitf1867dcad621ff4280c2710d3941383f382b9529 (patch)
tree368bb889f241af056e282d2d1ced73caa999e62f /source3/lib/util.c
parent67239541cdd0d1098be05f44d9f7a18e7604cef5 (diff)
downloadsamba-f1867dcad621ff4280c2710d3941383f382b9529.tar.gz
samba-f1867dcad621ff4280c2710d3941383f382b9529.tar.bz2
samba-f1867dcad621ff4280c2710d3941383f382b9529.zip
return NULL for a zero size memdup
(This used to be commit 9416b58b9c2ff898cdae2cb81ab1e150ef9f0e89)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 2f8b52ccbd..ccdfc72bbd 100644
--- a/source3/lib/util.c
+++ b/source3/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);