Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Possible memory leak in hist.c
- X-seq: zsh-workers 24812
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Possible memory leak in hist.c
- Date: Mon, 14 Apr 2008 15:27:35 +0200
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Hi,
Say that savehistfile is called with err = 0 and that unlink(tmpfile)
fails (hist.c, line 2204). Then it seems that tmpfile will never be
free'd because all the "free(tmpfile);" are in conditions that will
always be false.
Wouldn't it be simpler to replace all the "free(tmpfile);" by
if (tmpfile) {
free(tmpfile);
}
at the end?
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author