diff options
Diffstat (limited to 'api/src/glfs.c')
-rw-r--r-- | api/src/glfs.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c index 02a8984f450..8bd410c716d 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -664,7 +664,9 @@ priv_glfs_free_from_ctx (struct glfs *fs) (void) pthread_mutex_destroy (&fs->mutex); - FREE (fs->volname); + if (fs->volname) + FREE (fs->volname); + FREE (fs); } @@ -934,13 +936,17 @@ pub_glfs_fini (struct glfs *fs) } ctx = fs->ctx; + if (!ctx) { + goto free_fs; + } + + __glfs_entry_fs (fs); + if (ctx->mgmt) { rpc_clnt_disable (ctx->mgmt); ctx->mgmt = NULL; } - __glfs_entry_fs (fs); - call_pool = fs->ctx->pool; while (countdown--) { @@ -1069,6 +1075,7 @@ pub_glfs_fini (struct glfs *fs) if (glusterfs_ctx_destroy (ctx) != 0) ret = -1; +free_fs: glfs_free_from_ctx (fs); fail: |