aboutsummaryrefslogtreecommitdiffstats
path: root/ptr.c
diff options
context:
space:
mode:
authorKalev Lember <kalev@smartlink.ee>2009-04-11 17:55:36 (GMT)
committerKalev Lember <kalev@smartlink.ee>2009-04-11 19:19:33 (GMT)
commit20111dc4e5da4d9f5e2b4ba705181b7647b1377c (patch)
treec53de57cdcffbf12de59bd5f39e692fb7fdca864 /ptr.c
parent425355e88d9a8e82379028930d5eca82ac450e5b (diff)
downloadpowwow-20111dc4e5da4d9f5e2b4ba705181b7647b1377c.zip
powwow-20111dc4e5da4d9f5e2b4ba705181b7647b1377c.tar.gz
powwow-20111dc4e5da4d9f5e2b4ba705181b7647b1377c.tar.bz2
cmd.c: Fix a small memory leak in ptrdup2.
The new memory allocated in ptrdup2() did not get freed because it lacked p->signature = PTR_SIG.
Diffstat (limited to 'ptr.c')
-rw-r--r--ptr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ptr.c b/ptr.c
index 74e3c69..4c765b5 100644
--- a/ptr.c
+++ b/ptr.c
@@ -64,6 +64,7 @@ ptr ptrdup2 __P2 (ptr,src, int,newmax)
else if (!src)
p = ptrnew(newmax);
else if ((p = malloc(newmax + sizeofptr))) {
+ p->signature = PTR_SIG;
p->max = newmax;
if (newmax > ptrlen(src))
newmax = ptrlen(src);