summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.c
diff options
context:
space:
mode:
authorSantosh Kumar Pradhan <spradhan@redhat.com>2014-02-10 20:52:57 +0530
committerAnand Avati <avati@redhat.com>2014-02-12 17:40:31 -0800
commit1b88d86a660a5f4e007fb229d79c54666ce04ffb (patch)
treecef08f6419518bb0141773946276e41067b6cf97 /xlators/mgmt/glusterd/src/glusterd.c
parent547ee245dac4f2689a0f3f8f66635e0195489602 (diff)
glusterd: Fix possible leaks on failure code path
Fix the memory leaks in socket and glusterd in failure code paths reported by Coverity. CIDs: 1124777, 1124781, 124782 Change-Id: I63472c6b5900f308f19e64fc93bf7ed2f7b06ade BUG: 789278 Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com> Reviewed-on: http://review.gluster.org/6954 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 9da8a29902c..831cb82b28d 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -937,6 +937,14 @@ _install_mount_spec (dict_t *opts, char *key, data_t *value, void *data)
"adding %smount spec failed: label: %s desc: %s",
georep ? GEOREP" " : "", label, pdesc);
+ if (mspec) {
+ if (mspec->patterns) {
+ GF_FREE (mspec->patterns->components);
+ GF_FREE (mspec->patterns);
+ }
+ GF_FREE (mspec);
+ }
+
return -1;
}