From: Pasi Kallinen Date: Sat, 8 May 2010 09:02:46 +0000 (+0000) Subject: Make sure ipfile malloc gets freed in any case. X-Git-Tag: v1.6.1-roc-dev~148 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=fecd1b9361a9fc983167440e0b1e6b7d0ff09301;p=dgamelaunch Make sure ipfile malloc gets freed in any case. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@562 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- diff --git a/ttyrec.c b/ttyrec.c index 42aa769..225b4f6 100644 --- a/ttyrec.c +++ b/ttyrec.c @@ -205,7 +205,7 @@ ttyrec_main (int game, char *username, char *ttyrec_path, char* ttyrec_filename) sleep(1); } - unlink (ipfile); + remove_ipfile(); child = 0; return 0; @@ -359,7 +359,7 @@ done () (void) tcsetattr (0, TCSAFLUSH, &tt); } - unlink(ipfile); + remove_ipfile(); graceful_exit (0); } @@ -403,6 +403,9 @@ getslave () void remove_ipfile (void) { - if (ipfile != NULL) - unlink (ipfile); + if (ipfile != NULL) { + unlink (ipfile); + free(ipfile); + ipfile = NULL; + } }