[asterisk-commits] mjordan: branch 11 r386677 - in /branches/11: ./ main/config.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Apr 26 16:27:36 CDT 2013
Author: mjordan
Date: Fri Apr 26 16:27:32 2013
New Revision: 386677
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386677
Log:
Clean up memory leak in config file on off nominal paths when glob is allowed
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
Modified:
branches/11/ (props changed)
branches/11/main/config.c
Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/11/main/config.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/config.c?view=diff&rev=386677&r1=386676&r2=386677
==============================================================================
--- branches/11/main/config.c (original)
+++ branches/11/main/config.c Fri Apr 26 16:27:32 2013
@@ -1617,6 +1617,9 @@
AST_LIST_UNLOCK(&cfmtime_head);
ast_free(comment_buffer);
ast_free(lline_buffer);
+#ifdef AST_INCLUDE_GLOB
+ globfree(&globbuf);
+#endif
return CONFIG_STATUS_FILEUNCHANGED;
}
}
@@ -1627,6 +1630,9 @@
if (cfg == NULL) {
ast_free(comment_buffer);
ast_free(lline_buffer);
+#ifdef AST_INCLUDE_GLOB
+ globfree(&globbuf);
+#endif
return NULL;
}
More information about the asterisk-commits
mailing list