zsh-workers
 help / color / mirror / code / Atom feed
* Possible memory leak in hist.c
@ 2008-04-14 13:27 Vincent Lefevre
  2008-04-14 13:34 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Vincent Lefevre @ 2008-04-14 13:27 UTC (permalink / raw)
  To: zsh-workers

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@vinc17.org> - 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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-14 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-14 13:27 Possible memory leak in hist.c Vincent Lefevre
2008-04-14 13:34 ` Peter Stephenson
2008-04-14 14:42   ` Vincent Lefevre

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).