summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh@redhat.com>2012-03-16 16:59:45 +0530
committerAnand Avati <avati@redhat.com>2012-03-17 23:30:00 -0700
commitcba2f84cd084fdf005977690dce3c54fa9f8b133 (patch)
tree6faf6f53a712395b84eadf694e49a5f611764729 /rpc/rpc-lib
parentfb406f942befbe48eec75043d89ecd0824f91dd6 (diff)
rpc-lib: memleak fix in rpcsvc_volume_allowed
Change-Id: Iaa6baa4a3e036b2b5c808ea5e79017fffeb80a24 BUG: 801754 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/2956 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index 398bcdab805..515ec672732 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -2403,14 +2403,15 @@ rpcsvc_volume_allowed (dict_t *options, char *volname)
goto out;
}
- if (!dict_get (options, srchstr)) {
- GF_FREE (srchstr);
- srchstr = globalrule;
- ret = dict_get_str (options, srchstr, &addrstr);
- } else
+ if (!dict_get (options, srchstr))
+ ret = dict_get_str (options, globalrule, &addrstr);
+ else
ret = dict_get_str (options, srchstr, &addrstr);
out:
+ if (srchstr)
+ GF_FREE (srchstr);
+
return addrstr;
}