Add an exception handling 89/69689/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 16 May 2016 10:30:41 +0000 (19:30 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 16 May 2016 10:30:41 +0000 (19:30 +0900)
Change-Id: I08990a317a52402509024006008ba5930c0f11e6
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/aul_rsc_mgr_internal.c

index 7887b2e..7675969 100644 (file)
@@ -137,6 +137,10 @@ static int __parse_resource(xmlNode *xml_node, resource_data_t **data)
        xmlNode *tmp;
 
        *data = calloc(1, sizeof(resource_data_t));
+       if (*data == NULL) {
+               LOGE("out of memory");
+               return -1;
+       }
 
        for (tmp = xml_node->children; tmp; tmp = tmp->next) {
                if (tmp->type != XML_ELEMENT_NODE)