|
|
21ab4e |
From fb0892abcce6984230ecabd4191afeea997df204 Mon Sep 17 00:00:00 2001
|
|
|
21ab4e |
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
|
|
21ab4e |
Date: Mon, 14 Aug 2017 16:31:26 -0400
|
|
|
21ab4e |
Subject: [PATCH 604/604] api: memory leak in glfs_h_acl_get(), missing dict
|
|
|
21ab4e |
unref
|
|
|
21ab4e |
|
|
|
21ab4e |
master review https://review.gluster.org/17092 circa April 2017
|
|
|
21ab4e |
Fix already exists in release-3.12 and release-3.11 branches
|
|
|
21ab4e |
|
|
|
21ab4e |
Hat tip to Shyam (srangana[at]redhat.com) who found the existing
|
|
|
21ab4e |
fix after sitting and debugging it with me for several hours.
|
|
|
21ab4e |
|
|
|
21ab4e |
upstream Change-Id: Ic7169fd05aff7bf46108e8ac7b1f29688a7f2358
|
|
|
21ab4e |
|
|
|
21ab4e |
Change-Id: I954967113fd35da1f37603a70771289a67232e07
|
|
|
21ab4e |
Reported-by: Kinglong Mee <mijinlong@open-fs.com>
|
|
|
21ab4e |
BUG: 1481392
|
|
|
21ab4e |
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
|
|
21ab4e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/115321
|
|
|
21ab4e |
Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
|
|
21ab4e |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
21ab4e |
---
|
|
|
21ab4e |
api/src/glfs-handleops.c | 6 ++++--
|
|
|
21ab4e |
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
21ab4e |
|
|
|
21ab4e |
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
|
|
|
21ab4e |
index 88f9ab1..25eb861 100644
|
|
|
21ab4e |
--- a/api/src/glfs-handleops.c
|
|
|
21ab4e |
+++ b/api/src/glfs-handleops.c
|
|
|
21ab4e |
@@ -2303,13 +2303,15 @@ pub_glfs_h_acl_get (struct glfs *fs, struct glfs_object *object,
|
|
|
21ab4e |
goto out;
|
|
|
21ab4e |
|
|
|
21ab4e |
ret = dict_get_str (xattr, (char *)acl_key, &acl_s);
|
|
|
21ab4e |
- if (ret == -1)
|
|
|
21ab4e |
+ if (ret)
|
|
|
21ab4e |
goto out;
|
|
|
21ab4e |
|
|
|
21ab4e |
acl = acl_from_text (acl_s);
|
|
|
21ab4e |
|
|
|
21ab4e |
out:
|
|
|
21ab4e |
- GF_FREE (acl_s);
|
|
|
21ab4e |
+ if (xattr)
|
|
|
21ab4e |
+ dict_unref (xattr);
|
|
|
21ab4e |
+
|
|
|
21ab4e |
if (IA_ISLNK (object->inode->ia_type) && new_object)
|
|
|
21ab4e |
glfs_h_close (new_object);
|
|
|
21ab4e |
|
|
|
21ab4e |
--
|
|
|
21ab4e |
1.8.3.1
|
|
|
21ab4e |
|