Fix a static analysis issue 77/294477/2
authorChanggyu Choi <changyu.choi@samsung.com>
Tue, 20 Jun 2023 04:24:48 +0000 (13:24 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 20 Jun 2023 04:26:58 +0000 (13:26 +0900)
Changes:
 - Adds checking whether root is nullptr or not.

Change-Id: I694e8f0f696e9c4d4097adc876e7f868988458c8
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/aul_rsc_mgr_internal.c

index 24562a7..96f6fdd 100644 (file)
@@ -233,6 +233,10 @@ int _resource_open(const char *path, resource_data_t **data)
        if (doc == NULL)
                return -1;
        root = xmlDocGetRootElement(doc);
+       if (!root) {
+               xmlFreeDoc(doc);
+               return -1;
+       }
 
        ret = __parse_resource(root, data);