glib2/backport-glocalfileinfo-Fix-minor-leak-on-error-handling-path-for-xattrs.patch
shirely16 a3d31ddf3c synchronous community patch
(cherry picked from commit 5fb95aa15490a21b390e53a88c1b8b052971e504)
2021-05-21 15:56:45 +08:00

38 lines
960 B
Diff

From 15818926b360b99d7897e519d7414470870b2e58 Mon Sep 17 00:00:00 2001
From: Philip Withnall <withnall@endlessm.com>
Date: Wed, 30 Oct 2019 15:35:15 +0000
Subject: [PATCH 0099/1095] glocalfileinfo: Fix minor leak on error handling
path for xattrs
Spotted by `scan-build`.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
reason: Fix minor leak on error handling path for xattrs
Conflict:NA
Reference:https://github.com/GNOME/glib/commit/15818926b360b99d7897e519d7414470870b2e58
---
gio/glocalfileinfo.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index dcc9bce..5ba7691 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -504,7 +504,10 @@ get_xattrs (const char *path,
}
if (list_res_size == -1)
- return;
+ {
+ g_free (list);
+ return;
+ }
attr = list;
while (list_res_size > 0)
--
1.8.3.1