From 317cf418db598aeefa5021abb0280072d2bb1e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20H=C3=A5llberg?= Date: Thu, 1 Jan 2009 02:59:28 +0100 Subject: fixed memory leak caused by 'ptr' variables not getting their "signature" set diff --git a/ptr.c b/ptr.c index be3a4ae..74e3c69 100644 --- a/ptr.c +++ b/ptr.c @@ -188,6 +188,8 @@ ptr __ptrmcat __P4 (ptr,dst, char *,src, int,len, int,shrink) newmax = limit_mem; } if ((p = (ptr)realloc((void *)dst, newmax + sizeofptr))) { + if (dst == NULL) + p->signature = PTR_SIG; if (overlap) src = ptrdata(p) + (src - ptrdata(dst)); if (!dst) @@ -281,6 +283,8 @@ ptr __ptrmcpy __P4(ptr,dst, char *,src, int,len, int,shrink) } if ((p = (ptr)realloc((void *)dst, newmax + sizeofptr))) { + if (dst == NULL) + p->signature = PTR_SIG; if (overlap) src = ptrdata(p) + (src - ptrdata(dst)); if (!dst) -- cgit v0.10.2