Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: loadautofn memory leak
- X-seq: zsh-workers 25701
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: loadautofn memory leak
- Date: Sun, 21 Sep 2008 12:45:30 +0000
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
getfpfunc allocates memory for fname, which was not freed one these
codepaths.
Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.152
diff -u -r1.152 exec.c
--- Src/exec.c 16 Sep 2008 15:06:57 -0000 1.152
+++ Src/exec.c 21 Sep 2008 12:38:45 -0000
@@ -4134,10 +4134,13 @@
zwarn("%s: function definition file not found", shf->node.nam);
locallevel++;
popheap();
+ zsfree(fname);
return NULL;
}
- if (!prog)
+ if (!prog) {
+ zsfree(fname);
return NULL;
+ }
if (ksh == 2 || (ksh == 1 && isset(KSHAUTOLOAD))) {
if (autol) {
prog->flags |= EF_RUN;
@@ -4174,6 +4177,7 @@
shf->filename = fname;
}
popheap();
+ zsfree(fname);
return shf;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author