From ed82742933b694e8732fe01fc7c1c2542c027c26 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 19 Nov 2013 15:27:40 +0100 Subject: [SERVER] Stümperhaften double-free gefixt --- src/server/image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/image.c b/src/server/image.c index 356af43..172a0f3 100644 --- a/src/server/image.c +++ b/src/server/image.c @@ -665,6 +665,9 @@ static int image_try_load(char *base, char *path, int withUplink) image->rid = revision; image->users = 0; image->cacheFd = -1; + // Prevent freeing in cleanup + cache_map = NULL; + crc32list = NULL; if ( stat( path, &st ) == 0 ) { image->atime = st.st_mtime; } else { @@ -690,9 +693,6 @@ static int image_try_load(char *base, char *path, int withUplink) uplink_init( image, -1, NULL ); } } - // Prevent freeing in cleanup - cache_map = NULL; - crc32list = NULL; // Add to images array spin_lock( &_images_lock ); for (i = 0; i < _num_images; ++i) { -- cgit v1.2.3-55-g7522