meshctl: Fix possible use_after_free
authorGopal Tiwari <gtiwari@redhat.com>
Tue, 31 May 2022 07:41:16 +0000 (13:11 +0530)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
commit537f202af0fe1281aec751891f6c259b1766a2dc
tree441a522af37c233990d1ebe7616b1c4a5d5b725e
parentc3a5b992995b32f20730a0c17c36b876d7d23b41
meshctl: Fix possible use_after_free

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: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
tools/meshctl.c