Fix static analysis issue 29/271629/3
authorChanggyu Choi <changyu.choi@samsung.com>
Thu, 24 Feb 2022 00:36:30 +0000 (09:36 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Thu, 24 Feb 2022 00:50:11 +0000 (09:50 +0900)
Changes:
 - Adds checking that the parameters are nullptr.

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

index 24562a73033310ede3364cb7a726b2e45155f7ba..946c690ac5fc2f50c288fffaba9e3b659861cccb 100644 (file)
@@ -167,6 +167,9 @@ static int __parse_resource(xmlNode *xml_node, resource_data_t **data)
 {
        xmlNode *tmp;
 
+       if (!xml_node || !data)
+               return -1;
+
        *data = calloc(1, sizeof(resource_data_t));
        if (*data == NULL) {
                LOGE("out of memory");
@@ -227,7 +230,9 @@ int _resource_open(const char *path, resource_data_t **data)
        xmlDoc *doc;
        xmlNode *root;
 
-       if (__validate_schema(path))
+       if (!path)
+                return -1;
+        if (__validate_schema(path))
                return -1;
        doc = xmlReadFile(path, NULL, 0);
        if (doc == NULL)