From 3f26a7ba8d74af3c2f1c149160124e91fac534f8 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Mon, 14 Aug 2017 16:27:57 -0400 Subject: 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 Change-Id: Ic7169fd05aff7bf46108e8ac7b1f29688a7f2358 BUG: 1481398 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: https://review.gluster.org/18037 Smoke: Gluster Build System Reviewed-by: Kinglong Mee CentOS-regression: Gluster Build System Reviewed-by: Prashanth Pai Reviewed-by: Niels de Vos --- api/src/glfs-handleops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index a464b2ed195..b5fcfab713c 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -2297,13 +2297,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); -- cgit