summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXie Changlong <xiechanglong@cmss.chinamobile.com>2019-12-03 13:39:47 +0800
committerSunny Kumar <sunkumar@redhat.com>2019-12-04 17:16:30 +0000
commitd29b8e62a186770d26bf7daf3437d899ae00a0da (patch)
tree5e6ce7c0f6c7eb6006c7b12773cd9f77e0124dea
parentc65c0a72f4f1597ffa8bc0f8a8dc83abedf3e099 (diff)
glusterd-store: fix Coverity CID 1407767
To avoid memory leak. updates: bz#789278 Change-Id: I321c65a66c9ac372d059aa3ca89a989c6089979e Signed-off-by: Xie Changlong <xiechanglong@cmss.chinamobile.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index b8dedc64c95..e3a9274e8db 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -2659,6 +2659,8 @@ glusterd_store_retrieve_bricks(glusterd_volinfo_t *volinfo)
ret = gf_store_iter_get_matching(tmpiter, tmpkey, &tmpvalue);
len = snprintf(path, sizeof(path), "%s/%s", brickdir, tmpvalue);
+ GF_FREE(tmpvalue);
+ tmpvalue = NULL;
if ((len < 0) || (len >= sizeof(path))) {
ret = -1;
goto out;