diff options
Diffstat (limited to 'xlators/mgmt')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index 41559e75ea0..171d071efc3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -8264,12 +8264,13 @@ gd_restore_snap_volume (dict_t *dict, dict_t *rsp_dict, ret = 0; out: - if (ret && NULL != new_volinfo) { + if (ret) { /* In case of any failure we should free new_volinfo. Doing * this will also remove the entry we added in conf->volumes * if it was added there. */ - (void)glusterd_volinfo_delete (new_volinfo); + if (new_volinfo) + (void)glusterd_volinfo_delete (new_volinfo); } else { list_for_each_entry_safe (voliter, temp_volinfo, &orig_vol->snap_volumes, snapvol_list) { |