From d737a3f43c9b286e5a35c27ee017ba3549cfd3f8 Mon Sep 17 00:00:00 2001 From: Changgyu Choi Date: Tue, 20 Jun 2023 13:24:48 +0900 Subject: [PATCH] Fix a static analysis issue Changes: - Adds checking whether root is nullptr or not. Change-Id: I694e8f0f696e9c4d4097adc876e7f868988458c8 Signed-off-by: Changgyu Choi --- src/aul_rsc_mgr_internal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/aul_rsc_mgr_internal.c b/src/aul_rsc_mgr_internal.c index 24562a7..96f6fdd 100644 --- a/src/aul_rsc_mgr_internal.c +++ b/src/aul_rsc_mgr_internal.c @@ -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); -- 2.7.4