diff mbox series

[Bluez,1/6] Fix leak in mesh

Message ID 20210514095807.62f40ff5@ivy-bridge
State New
Headers show
Series [Bluez,1/6] Fix leak in mesh | expand

Commit Message

Steve Grubb May 14, 2021, 1:58 p.m. UTC
The dir variable needs to be closed before leaving.

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

Patch

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));