diff options
author | Simon Rettberg | 2013-11-19 15:27:40 +0100 |
---|---|---|
committer | Simon Rettberg | 2013-11-19 15:27:40 +0100 |
commit | ed82742933b694e8732fe01fc7c1c2542c027c26 (patch) | |
tree | 3b010cc07cb1b7b4d7d98def0eaf2a837b4d0075 | |
parent | [SERVER] Like kernel module, request first block, not random one (diff) | |
download | dnbd3-ed82742933b694e8732fe01fc7c1c2542c027c26.tar.gz dnbd3-ed82742933b694e8732fe01fc7c1c2542c027c26.tar.xz dnbd3-ed82742933b694e8732fe01fc7c1c2542c027c26.zip |
[SERVER] Stümperhaften double-free gefixt
-rw-r--r-- | src/server/image.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |