diff options
author | Gustav HÃ¥llberg <gustav@gmail.com> | 2009-01-01 01:59:28 (GMT) |
---|---|---|
committer | Gustav HÃ¥llberg <gustav@gmail.com> | 2009-01-16 23:38:32 (GMT) |
commit | 317cf418db598aeefa5021abb0280072d2bb1e25 (patch) | |
tree | 4c400a461c401e6eaa252a215f663f002335cf6d | |
parent | 946b7deef9b5910f0e89b36a6110b8d3c6ef5fd4 (diff) | |
download | powwow-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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) |