Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Possible memory leak in hist.c



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