Fix a static analysis issue
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 06:43:43 +0000 (15:43 +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 24562a73033310ede3364cb7a726b2e45155f7ba..96f6fddd56d0f1bc9e1ad7916c48e07375e1a444 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);