diff mbox series

[Bluez,V2,12/13] Fixing possible use_after_free in meshctl.c

Message ID 20220531074117.610321-13-gopalkrishna.tiwari@gmail.com
State Superseded
Headers show
Series Fixing memory leak, leaked_handle and use_after | expand

Commit Message

Gopal Tiwari May 31, 2022, 7:41 a.m. UTC
From: Gopal Tiwari <gtiwari@redhat.com>

Reported by coverity tool as follows :

bluez-5.64/tools/meshctl.c:1968: freed_arg: "g_free" frees "mesh_dir".

bluez-5.64/tools/meshctl.c:2018: double_free: Calling "g_free" frees 
pointer "mesh_dir" which has already been freed.

Signed-off-by: Gopal Tiwari <gtiwari@redhat.com>
---
 tools/meshctl.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/meshctl.c b/tools/meshctl.c
index 18e20c40d..38ffd35f3 100644
--- a/tools/meshctl.c
+++ b/tools/meshctl.c
@@ -2015,7 +2015,6 @@  int main(int argc, char *argv[])
 
 fail:
 	bt_shell_cleanup();
-	g_free(mesh_dir);
 
 	return EXIT_FAILURE;
 }