# HG changeset patch # User nenolod # Date 1181394963 25200 # Node ID 2f3397e53b052e350e5ba3fa619b43e5fe2bd172 # Parent cc6df5de72a67b3a6e3716ce32efa654d5a233b9 [svn] - memory cleanups, purify-assisted. diff -r cc6df5de72a6 -r 2f3397e53b05 ChangeLog --- a/ChangeLog Sat Jun 09 06:10:17 2007 -0700 +++ b/ChangeLog Sat Jun 09 06:16:03 2007 -0700 @@ -1,3 +1,11 @@ +2007-06-09 13:10:17 +0000 William Pitcock + revision [2554] + - fix invalid write of size 4 (actuators.c:56) + + trunk/src/paranormal/actuators.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + 2007-06-08 22:02:31 +0000 William Pitcock revision [2552] - use g_random_double_ranged() diff -r cc6df5de72a6 -r 2f3397e53b05 src/paranormal/libcalc/dict.c --- a/src/paranormal/libcalc/dict.c Sat Jun 09 06:10:17 2007 -0700 +++ b/src/paranormal/libcalc/dict.c Sat Jun 09 06:16:03 2007 -0700 @@ -35,8 +35,7 @@ dict->v_space += V_SPACE_INCR; - new_var = (var_t *)g_malloc (dict->v_space * sizeof(var_t)); - + new_var = g_new(var_t, dict->v_space + 1); memcpy (new_var, dict->variables, dict->v_count * sizeof(var_t)); g_free (dict->variables); @@ -65,7 +64,7 @@ global_dict.v_count = 0; global_dict.v_space = V_SPACE_INIT; - global_dict.variables = (var_t *) g_new(var_t, global_dict.v_space); + global_dict.variables = (var_t *) g_new(var_t, global_dict.v_space + 1); global_dict_initialized = 1; for (i = 0; i < 100; i++) { @@ -80,7 +79,7 @@ /* Allocate space for variables. */ dict->v_count = 0; dict->v_space = V_SPACE_INIT; - dict->variables = (var_t *) g_new (var_t, dict->v_space); + dict->variables = (var_t *) g_new (var_t, dict->v_space + 1); return dict; }