diff --git a/src/store_memcached.c b/src/store_memcached.c index 8ddf8a4c..981b8b10 100644 --- a/src/store_memcached.c +++ b/src/store_memcached.c @@ -264,6 +264,7 @@ static int memcached_metatile_expire(struct storage_backend * store, const char static int memcached_close_storage(struct storage_backend * store) { memcached_free(store->storage_ctx); + store->storage_ctx = NULL; return 0; } diff --git a/src/store_rados.c b/src/store_rados.c index 2d6d311a..c057a804 100644 --- a/src/store_rados.c +++ b/src/store_rados.c @@ -329,6 +329,7 @@ static int rados_close_storage(struct storage_backend * store) free(ctx->metadata_cache.data); free(ctx->pool); free(ctx); + store->storage_ctx = NULL; return 0; } diff --git a/src/store_ro_composite.c b/src/store_ro_composite.c index 998be917..8faf4b4d 100644 --- a/src/store_ro_composite.c +++ b/src/store_ro_composite.c @@ -210,7 +210,7 @@ static int ro_composite_close_storage(struct storage_backend * store) } free(ctx); - free(store); + store->storage_ctx = NULL; return 0; } diff --git a/src/store_ro_http_proxy.c b/src/store_ro_http_proxy.c index 00f95b2e..69925fb7 100644 --- a/src/store_ro_http_proxy.c +++ b/src/store_ro_http_proxy.c @@ -242,8 +242,7 @@ static int ro_http_proxy_close_storage(struct storage_backend * store) curl_easy_cleanup(ctx->ctx); free(ctx); - free(store); - + store->storage_ctx = NULL; return 0; }