This patch fixes SVACE issue. 58/317358/3
authorSameer Kumar <sameer.kumar@samsung.com>
Mon, 9 Sep 2024 09:30:43 +0000 (15:00 +0530)
committerSameer Kumar <sameer.kumar@samsung.com>
Mon, 9 Sep 2024 10:33:22 +0000 (16:03 +0530)
Issue ID: 244574

Change-Id: I9be2a7bd1713c49e2f9d977c18760b883a0a87c4
Signed-off-by: Sameer Kumar <sameer.kumar@samsung.com>
bt-service/services/mesh/bt-service-mesh-cdb.c

index cdf1ab8016ba5920ab84adcb6938412e8ddb0831..bb737343ef49c820c6e47ef1de86f659c0d9c8a3 100644 (file)
@@ -798,11 +798,11 @@ bool _bt_mesh_conf_insert_node_object(_bt_mesh_cdb_t *cfg,
        if (!json_object_object_get_ex(cfg->jcfg, "nodes", &jnodes))
                goto fail;
 
-       json_object_array_add(jnodes, jnode);
-
        if (!__bt_mesh_save_configruation_file(cfg))
                goto fail;
 
+       json_object_array_add(jnodes, jnode);
+
        return true;
 
 fail: