From 0eddd488a046ace91bc308513175c01a7f0bcf49 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Thu, 20 Jan 2005 04:03:37 +0000 Subject: [PATCH] free the pointer array, and clean up some comments --- src/tuxpaint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index c3b7b4194..01ec140b0 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -6809,7 +6809,7 @@ static void loadstamp_callback(const char *restrict const dir, unsigned dirlen, snprintf(fname, sizeof fname, "%s/%s", dir, files[i].str); if(num_stamps == max_stamps) { - max_stamps = max_stamps * 5 / 4 + 3; + max_stamps = max_stamps * 5 / 4 + 15; stamp_data = realloc(stamp_data, max_stamps * sizeof *stamp_data); } stamp_data[num_stamps] = calloc(1, sizeof *stamp_data[num_stamps]); @@ -6829,7 +6829,7 @@ static void loadstamp_callback(const char *restrict const dir, unsigned dirlen, stamp_data[num_stamps]->ssnd = use_sound ? loadsound(fname) : NULL; #endif loadstamp_finisher(num_stamps); - num_stamps++; // FIXME: no limit and no resizing right now... + num_stamps++; } else { @@ -12058,6 +12058,7 @@ static void cleanup(void) free(stamp_data[i]); stamp_data[i] = NULL; } + free(stamp_data); free_surface_array( img_brushes, num_brushes ); free_surface_array( img_tools, NUM_TOOLS );