summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2017-08-14 16:18:42 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2017-08-15 10:37:11 +0000
commit040e0e4d5f6fd0919cfd71850f696c41d4663244 (patch)
tree4f6614627efc3d182a600f9dcda9aab8a3387eb8 /api
parent013291cd46e475a09e3f33b2a8f4a37684af3319 (diff)
api: memory leak in glfs_h_acl_get(), missing dict unref
master review https://review.gluster.org/17092 circa April 2017 Fix already exists in release-3.12 and release-3.11 branches Hat tip to Shyam (srangana[at]redhat.com) who found the existing fix after sitting and debugging it with me for several hours. Reported-by: Kinglong Mee <mijinlong@open-fs.com> Change-Id: Ic7169fd05aff7bf46108e8ac7b1f29688a7f2358 BUG: 1481394 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: https://review.gluster.org/18036 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kinglong Mee <kinglongmee@gmail.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-handleops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 84dba5b82c5..e08a274be8d 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -2295,13 +2295,15 @@ pub_glfs_h_acl_get (struct glfs *fs, struct glfs_object *object,
goto out;
ret = dict_get_str (xattr, (char *)acl_key, &acl_s);
- if (ret == -1)
+ if (ret)
goto out;
acl = acl_from_text (acl_s);
out:
- GF_FREE (acl_s);
+ if (xattr)
+ dict_unref (xattr);
+
if (IA_ISLNK (object->inode->ia_type) && new_object)
glfs_h_close (new_object);