mesh: Fix memory leak and NULL pointer dereference
authorInga Stotland <inga.stotland@intel.com>
Tue, 10 Nov 2020 04:21:27 +0000 (20:21 -0800)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Mon, 28 Dec 2020 06:20:04 +0000 (11:50 +0530)
commit641be667a07794f8beb8fe826d8bd4e0bd6c302d
tree275f05b1fbd32fe31569e40699cb24cde8c1659a
parent50c4465ce4e124af8dc1e94cca741eb72ca539ae
mesh: Fix memory leak and NULL pointer dereference

This fixes a potential NULL pointer dereferencing in mesh_model_pub_set()
when virtual address publication cannot be successfully stored.
Also, fix a minor memory leak that may occur on unsuccessful model
initialization from storage.

Change-Id: Ic5de82e7109237c7aa411e27c544b5fe2164a3d4
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
mesh/model.c