[genius] Wed Dec 23 15:18:56 2009 Jiri (George) Lebl <jirka 5z com>



commit e1f2a4b7f381fcbe8b6375462ffc50fd2006e0ab
Author: Jiri (George) Lebl <jirka 5z com>
Date:   Wed Dec 23 15:24:30 2009 -0600

    Wed Dec 23 15:18:56 2009  Jiri (George) Lebl <jirka 5z com>
    
    	* src/calc.c: fix minor leak
    
    	* src/eval.c: fix MEM_DEBUG_FRIENDLY compilation

 ChangeLog    |    6 ++++++
 NEWS         |    6 ++++++
 configure.in |    2 +-
 src/calc.c   |    8 ++++++--
 src/eval.c   |   16 +++++++++-------
 5 files changed, 28 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1864fe9..e5f2427 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Dec 23 15:18:56 2009  Jiri (George) Lebl <jirka 5z com>
+
+	* src/calc.c: fix minor leak
+
+	* src/eval.c: fix MEM_DEBUG_FRIENDLY compilation
+
 Wed Dec 23 14:09:21 2009  Jiri (George) Lebl <jirka 5z com>
 
 	* src/graphing.c, src/util.c: fix use of strcpy
diff --git a/NEWS b/NEWS
index 449d7f5..7155285 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+Changes to 1.0.9
+
+* Fix matrix expansion.  This also fixes AuxilliaryUnitMatrix and JordanBlock.
+* Fix several possible crashers.
+* Fix a minor memory leak.
+
 Changes to 1.0.8
 
 * Buildfixes for Cygwin and parallel builds (Yaakov)
diff --git a/configure.in b/configure.in
index f50fd28..19b967a 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
 AC_INIT(src/calc.c)
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(genius,1.0.8)
+AM_INIT_AUTOMAKE(genius,1.0.9)
 
 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
diff --git a/src/calc.c b/src/calc.c
index 7e3ac4a..9033321 100644
--- a/src/calc.c
+++ b/src/calc.c
@@ -2299,7 +2299,6 @@ load_compiled_fp (const char *file, FILE *fp)
 		b2 = g_new(char,size+2);
 		if G_UNLIKELY (!fgets(b2,size+2,fp)) {
 			gel_errorout (_("Missing value for function"));
-			g_free(b2);
 			g_slist_free(li);
 			goto continue_reading;
 		}
@@ -2332,6 +2331,7 @@ load_compiled_fp (const char *file, FILE *fp)
 		} else {
 			GelEFunc *func;
 			tok->uncompiled = b2;
+			b2 = NULL;
 			if(type == GEL_USER_FUNC) {
 				func = d_makeufunc (tok, NULL, li, nargs, NULL);
 				func->vararg = vararg ? 1 : 0;
@@ -2349,7 +2349,11 @@ load_compiled_fp (const char *file, FILE *fp)
 			last_func = func;
 			d_addfunc (func);
 		}
-continue_reading:	;
+continue_reading:
+		if (b2 != NULL) {
+			g_free (b2);
+			b2 = NULL;
+		}
 	}
 	fclose(fp);
 	g_free (buf);
diff --git a/src/eval.c b/src/eval.c
index c78a10c..a021c9c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -8153,14 +8153,8 @@ resimplify:
 	}
 }
 
-#ifndef MEM_DEBUG_FRIENDLY
-/* In tests it seems that this achieves better then 4096 */
-#define GEL_CHUNK_SIZE 4048
-#define ALIGNED_SIZE(t) (sizeof(t) + sizeof (t) % G_MEM_ALIGN)
-
-static long _gel_tree_num = 0;
+/* we define these even if MEM_DEBUG_FRIENDLY is on */
 static gboolean _gel_max_nodes_check = TRUE;
-
 /* Will get to the warning another page later, but that's OK
  * we don't expect this to be happening often */
 void
@@ -8169,6 +8163,14 @@ gel_test_max_nodes_again (void)
 	_gel_max_nodes_check = TRUE;
 }
 
+
+#ifndef MEM_DEBUG_FRIENDLY
+/* In tests it seems that this achieves better then 4096 */
+#define GEL_CHUNK_SIZE 4048
+#define ALIGNED_SIZE(t) (sizeof(t) + sizeof (t) % G_MEM_ALIGN)
+
+static long _gel_tree_num = 0;
+
 void
 _gel_make_free_trees (void)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]