1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-12 18:13:50 -05:00

When asked to malloc zero bytes, malloc one byte instead. This ensures

that we get a unique pointer rather than NULL (which ANSI C otherwise permits).
Problem pointed out by Mike Protts.

[originally from svn r6308]
This commit is contained in:
Ben Harris 2005-09-13 20:17:10 +00:00
parent 059e409c82
commit f2d8fd97d0

1
misc.c
View File

@ -441,6 +441,7 @@ void *safemalloc(size_t n, size_t size)
p = NULL;
} else {
size *= n;
if (size == 0) size = 1;
#ifdef MINEFIELD
p = minefield_c_malloc(size);
#else