aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav HÃ¥llberg <gustav@gmail.com>2009-01-01 01:59:28 (GMT)
committerGustav HÃ¥llberg <gustav@gmail.com>2009-01-16 23:38:32 (GMT)
commit317cf418db598aeefa5021abb0280072d2bb1e25 (patch)
tree4c400a461c401e6eaa252a215f663f002335cf6d
parent946b7deef9b5910f0e89b36a6110b8d3c6ef5fd4 (diff)
downloadpowwow-317cf418db598aeefa5021abb0280072d2bb1e25.zip
powwow-317cf418db598aeefa5021abb0280072d2bb1e25.tar.gz
powwow-317cf418db598aeefa5021abb0280072d2bb1e25.tar.bz2
fixed memory leak caused by 'ptr' variables not getting their "signature" set
-rw-r--r--ptr.c4
1 files changed, 4 insertions, 0 deletions
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)