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

Fix memory leak in iniFreeParsedSections(), wasn't freeing the list member

The 'list' member was allocated by iniParseSections() but never freed.

Caught be Nelgin's recent valgrind report, e.g.:

==2725235== 56 bytes in 1 blocks are indirectly lost in loss record 82 of 191
==2725235==    at 0x484DCD3: realloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2725235==    by 0x4FA351C: strListAnnex (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libsbbs.so)
==2725235==    by 0x4F9ADDE: iniParseSections (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libsbbs.so)
==2725235==    by 0x49F1F0A: read_chat_cfg (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libsbbs.so)
==2725235==    by 0x49E8BF1: load_cfg (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libsbbs.so)
==2725235==    by 0x5C14C75: ftp_server (in /home/bbs/sbbs/repo/src/sbbs3/gcc.linux.x64.lib.release/libftpsrvr.so)
==2725235==    by 0x5D5AB42: start_thread (pthread_create.c:442)
==2725235==    by 0x5DEBBB3: clone (clone.S:100)
parent c267c327
No related branches found
No related tags found
No related merge requests found
...@@ -1605,6 +1605,7 @@ void* iniFreeParsedSections(named_str_list_t** list) ...@@ -1605,6 +1605,7 @@ void* iniFreeParsedSections(named_str_list_t** list)
for(i = 0; list[i] != NULL; ++i) { for(i = 0; list[i] != NULL; ++i) {
free(list[i]->name); free(list[i]->name);
free(list[i]->list);
free(list[i]); free(list[i]);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment