Pacify valgrind: it doesn't know realloc(p, 0) is equivalent to free(p).

This commit is contained in:
Tor Andersson
2016-12-23 16:13:18 +01:00
committed by Tor Andersson
parent eafe79436d
commit 86feee5b7b

View File

@@ -9,6 +9,10 @@
static void *js_defaultalloc(void *actx, void *ptr, int size)
{
if (size == 0) {
free(ptr);
return NULL;
}
return realloc(ptr, (size_t)size);
}