1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-12 12:23:50 +03:00

return NULL for a zero size memdup

This commit is contained in:
Andrew Tridgell
-
parent d0fc1675df
commit 9416b58b9c

View File

@@ -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);