All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez PATCH 1/6] Fix leak in mesh
@ 2021-05-14 13:58 Steve Grubb
  2021-05-14 14:11 ` Fix various memory leaks bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Grubb @ 2021-05-14 13:58 UTC (permalink / raw)
  To: linux-bluetooth


The dir variable needs to be closed before leaving.

---
 mesh/rpl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mesh/rpl.c b/mesh/rpl.c
index ac0f6b6f2..c53c6fbfd 100644
--- a/mesh/rpl.c
+++ b/mesh/rpl.c
@@ -143,8 +143,10 @@ static void get_entries(const char *iv_path, struct l_queue *rpl_list)
 		return;
 
 	iv_txt = basename(iv_path);
-	if (sscanf(iv_txt, "%08x", &iv_index) != 1)
+	if (sscanf(iv_txt, "%08x", &iv_index) != 1) {
+		closedir(dir);
 		return;
+	}
 
 	memset(seq_txt, 0, sizeof(seq_txt));
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [Bluez PATCH 1/6] Fix leak in mesh
@ 2021-05-12 21:35 Steve Grubb
  2021-05-12 23:06 ` Fix various memory leaks bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Grubb @ 2021-05-12 21:35 UTC (permalink / raw)
  To: linux-bluetooth



The dir variable needs to be closed before leaving.

Signed-off-by: Steve Grubb <sgrubb@redhat.com>
---
 mesh/rpl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mesh/rpl.c b/mesh/rpl.c
index ac0f6b6f2..c53c6fbfd 100644
--- a/mesh/rpl.c
+++ b/mesh/rpl.c
@@ -143,8 +143,10 @@ static void get_entries(const char *iv_path, struct l_queue *rpl_list)
 		return;
 
 	iv_txt = basename(iv_path);
-	if (sscanf(iv_txt, "%08x", &iv_index) != 1)
+	if (sscanf(iv_txt, "%08x", &iv_index) != 1) {
+		closedir(dir);
 		return;
+	}
 
 	memset(seq_txt, 0, sizeof(seq_txt));
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-14 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-14 13:58 [Bluez PATCH 1/6] Fix leak in mesh Steve Grubb
2021-05-14 14:11 ` Fix various memory leaks bluez.test.bot
  -- strict thread matches above, loose matches on Subject: below --
2021-05-12 21:35 [Bluez PATCH 1/6] Fix leak in mesh Steve Grubb
2021-05-12 23:06 ` Fix various memory leaks bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.