[Tux4kids-commits] r203 - tuxmath/trunk/src

tholy-guest at alioth.debian.org tholy-guest at alioth.debian.org
Mon Aug 20 11:34:15 UTC 2007


Author: tholy-guest
Date: 2007-08-20 11:34:14 +0000 (Mon, 20 Aug 2007)
New Revision: 203

Modified:
   tuxmath/trunk/src/fileops.c
Log:
Fix memory leak in reading blank lines in parameter files.


Modified: tuxmath/trunk/src/fileops.c
===================================================================
--- tuxmath/trunk/src/fileops.c	2007-08-20 09:04:19 UTC (rev 202)
+++ tuxmath/trunk/src/fileops.c	2007-08-20 11:34:14 UTC (rev 203)
@@ -614,6 +614,11 @@
     {
       ++param_begin;
     }
+
+    /* If this was a blank line, then we don't have to process any more */
+    if (param_begin-buf >= strlen(buf))
+      continue;
+
     /* now go from here to end of string, stopping at either */
     /* whitespace or '=':   */
     param_end = param_begin;
@@ -641,6 +646,7 @@
       //fprintf(stderr, "Error while reading prefs - line with no '='!\n");
       #endif
 
+      free(parameter);
       continue;
     }
 




More information about the Tux4kids-commits mailing list