Skip to content
Snippets Groups Projects
Commit ec0e0ee4 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix a couple of resource leaks in iniSortSections()

One in an error path (CID 331353), the other not.
parent 97650f46
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2119 passed
...@@ -462,6 +462,7 @@ BOOL iniSortSections(str_list_t* list, BOOL sort_keys) ...@@ -462,6 +462,7 @@ BOOL iniSortSections(str_list_t* list, BOOL sort_keys)
new_list = strListInit(); new_list = strListInit();
if(new_list == NULL) { if(new_list == NULL) {
strListFree(&section_list); strListFree(&section_list);
strListFree(&root_keys);
return FALSE; return FALSE;
} }
strListAppendList(&new_list, root_keys); strListAppendList(&new_list, root_keys);
...@@ -473,6 +474,7 @@ BOOL iniSortSections(str_list_t* list, BOOL sort_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); iniAppendSectionWithKeys(&new_list, section_list[i], keys, /* ini_style_t */NULL);
strListFree(&keys); strListFree(&keys);
} }
strListFree(&section_list);
strListFree(list); strListFree(list);
*list = new_list; *list = new_list;
return TRUE; return TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment