If a system allows for its usage, Asterisk will use glob to help parse
Asterisk .conf files. The config file loading routine was leaking the memory
allocated by the glob() routine when the config file was in an unmodified
or invalid state.
This patch properly calls globfree in those off nominal paths.
(closes issue ASTERISK-21412)
Reported by: Corey Farrell
patches:
config_glob_leak.patch uploaded by Corey Farrell (license 5909)
........
Merged revisions 386672 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 386677 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386685
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
AST_LIST_UNLOCK(&cfmtime_head);
ast_free(comment_buffer);
ast_free(lline_buffer);
+#ifdef AST_INCLUDE_GLOB
+ globfree(&globbuf);
+#endif
return CONFIG_STATUS_FILEUNCHANGED;
}
}
if (cfg == NULL) {
ast_free(comment_buffer);
ast_free(lline_buffer);
+#ifdef AST_INCLUDE_GLOB
+ globfree(&globbuf);
+#endif
return NULL;
}