summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2013-11-19 15:27:40 +0100
committerSimon Rettberg2013-11-19 15:27:40 +0100
commited82742933b694e8732fe01fc7c1c2542c027c26 (patch)
tree3b010cc07cb1b7b4d7d98def0eaf2a837b4d0075 /src
parent[SERVER] Like kernel module, request first block, not random one (diff)
downloaddnbd3-ed82742933b694e8732fe01fc7c1c2542c027c26.tar.gz
dnbd3-ed82742933b694e8732fe01fc7c1c2542c027c26.tar.xz
dnbd3-ed82742933b694e8732fe01fc7c1c2542c027c26.zip
[SERVER] Stümperhaften double-free gefixt
Diffstat (limited to 'src')
-rw-r--r--src/server/image.c6
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) {