1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

return NULL for a zero size memdup

(This used to be commit 9416b58b9c)
This commit is contained in:
Andrew Tridgell
2000-04-22 08:29:41 +00:00
parent 67239541cd
commit f1867dcad6

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