From: <and...@pr...> - 2004-01-28 12:38:10
|
Update of /cvsroot/plplot/plplot/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6261/src Modified Files: plcore.c Log Message: Fix 3 memory leaks found using plrender on x01c example. Any tcl_cmd command line options do not get memory freed on exit in plcore.c If a stream is not fully initialised the FileName string associated with it is not freed in plcore.c There is a malloc without a free in plrender.c Index: plcore.c =================================================================== RCS file: /cvsroot/plplot/plplot/src/plcore.c,v retrieving revision 1.125 retrieving revision 1.126 diff -u -d -r1.125 -r1.126 --- plcore.c 23 Jan 2004 15:00:09 -0000 1.125 +++ plcore.c 28 Jan 2004 12:36:59 -0000 1.126 @@ -154,7 +154,9 @@ plbuf_tidy(plsc); plsc->OutFile = NULL; - free_mem(plsc->FileName); + + if (plsc->tcl_cmd) + free_mem(plsc->tcl_cmd); } /* Change state. */ @@ -1352,6 +1354,9 @@ plP_tidy(); plsc->level = 0; } + /* Move from plP_tidy because FileName may be set even if level == 0 */ + if (plsc->FileName) + free_mem(plsc->FileName); /* Free all malloc'ed stream memory */ |