Mesh: Fix crash due to derefence of NULL pointer 46/243946/1 accepted/tizen/unified/20200914.131334 submit/tizen/20200913.230045
authorAbhay Agarwal <ay.agarwal@samsung.com>
Fri, 11 Sep 2020 09:36:37 +0000 (15:06 +0530)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Fri, 11 Sep 2020 09:56:01 +0000 (15:26 +0530)
commitfea68267b586dfeffcff2cb71ac53bb0941bc1be
tree0c7024a6c7ab32d42e109936bd8f9a242a0c4b6a
parentd47265b5ac64c3e0cea7e3c00d37aec9e0c667c5
Mesh: Fix crash due to derefence of NULL pointer

This patch fix the crash occured due to dererencing without null check

(gdb) bt
0  0xf7051b4a in g_slist_length () from /lib/libglib-2.0.so.0
1  0xf716ab6c in __bt_mesh_destroy_network_handles (net=net@entry=0x1fc9100) at /usr/src/debug/capi-network-bluetooth-0.6.0/src/bluetooth-mesh.c:869
2  0xf716ae14 in __bt_mesh_destroy_network_handles (net=0x1fc9100) at /usr/src/debug/capi-network-bluetooth-0.6.0/src/bluetooth-mesh.c:854
3  __mesh_unload_network_configurations (data=0x1fc9100, user_data=<optimized out>) at /usr/src/debug/capi-network-bluetooth-0.6.0/src/bluetooth-mesh.c:709
4  0xf7051b6c in g_slist_foreach () from /lib/libglib-2.0.so.0
5  0xf716bc9e in bt_mesh_deinitialize () at /usr/src/debug/capi-network-bluetooth-0.6.0/src/bluetooth-mesh.c:731

Change-Id: I25aee100d88f4fa281cdeb6f04b64bf6d60184ff
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
src/bluetooth-mesh.c