From ec0e0ee47efb1427ef894920fff20d25f0c43d15 Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Tue, 4 May 2021 11:13:25 -0700
Subject: [PATCH] Fix  a couple of resource leaks in iniSortSections()

One in an error path (CID 331353), the other not.
---
 src/xpdev/ini_file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/xpdev/ini_file.c b/src/xpdev/ini_file.c
index 92df56ab67..9bcf1a6f20 100644
--- a/src/xpdev/ini_file.c
+++ b/src/xpdev/ini_file.c
@@ -462,6 +462,7 @@ BOOL iniSortSections(str_list_t* list, BOOL sort_keys)
 	new_list = strListInit();
 	if(new_list == NULL) {
 		strListFree(&section_list);
+		strListFree(&root_keys);
 		return FALSE;
 	}
 	strListAppendList(&new_list, root_keys);
@@ -473,6 +474,7 @@ BOOL iniSortSections(str_list_t* list, BOOL sort_keys)
 		iniAppendSectionWithKeys(&new_list, section_list[i], keys, /* ini_style_t */NULL);
 		strListFree(&keys);
 	}
+	strListFree(&section_list);
 	strListFree(list);
 	*list = new_list;
 	return TRUE;
-- 
GitLab