api: fix bad release of dict causes memory leak
Change-Id: Ic7169fd05aff7bf46108e8ac7b1f29688a7f2358 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com> Reviewed-on: https://review.gluster.org/17092 Tested-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Poornima G <pgurusid@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com>
This commit is contained in:
parent
6d021a2810
commit
fb66df4c44
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user