Fix memory leak issue 14/96714/1
authorWonnam Jang <wn.jang@samsung.com>
Thu, 10 Nov 2016 03:03:47 +0000 (12:03 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Thu, 10 Nov 2016 03:03:47 +0000 (12:03 +0900)
Change-Id: Ic31fc6bd4f4fa49e6ffac2bb165238f1c41c5293
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
common/vc_info_parser.c

index 83847cf..c4fc2d4 100644 (file)
@@ -191,6 +191,7 @@ int vc_info_parser_get_demandable_clients(GSList** client_list)
 
                                if (NULL == temp_client) {
                                        SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Memory alloc error!!");
+                                       xmlFreeDoc(doc);
                                        return -1;
                                }
 
@@ -279,6 +280,7 @@ int vc_info_parser_set_demandable_client(const char* filepath)
        int ret = xmlSaveFormatFile(VC_RUNTIME_INFO_DEMANDABLE_LIST, doc, 1);
        SLOG(LOG_DEBUG, vc_info_tag(), "Save demandable file info : %d", ret);
 
+       xmlFreeDoc(doc);
        return 0;
 }
 
@@ -561,6 +563,7 @@ int vc_info_parser_get_client_info(GSList** client_info_list)
 
                if (NULL == client) {
                        SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Memory alloc error!!");
+                       xmlFreeDoc(doc);
                        return -1;
                }