[asterisk-bugs] [Asterisk 0016574]: Memory leak on reload_config
Asterisk Bug Tracker
noreply at bugs.digium.com
Sun Jan 10 22:07:48 CST 2010
A NOTE has been added to this issue.
======================================================================
https://issues.asterisk.org/view.php?id=16574
======================================================================
Reported By: ddv2005
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 16574
Category: Addons/General
Reproducibility: always
Severity: major
Priority: normal
Status: new
Asterisk Version: 1.6.1.12
JIRA:
Regression: No
Reviewboard Link:
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
======================================================================
Date Submitted: 2010-01-10 21:57 CST
Last Modified: 2010-01-10 22:07 CST
======================================================================
Summary: Memory leak on reload_config
Description:
I found possible memory leak on reload_config in many modules (chan_sip as
well).
Source code look like:
==============================
cfg = ast_config_load(config, config_flags);
/* We *must* have a config file otherwise stop immediately */
if (!cfg) {
ast_log(LOG_NOTICE, "Unable to load config %s\n",
config);
return -1;
} else if (cfg == CONFIG_STATUS_FILEUNCHANGED) {
ucfg = ast_config_load("users.conf", config_flags);
if (ucfg == CONFIG_STATUS_FILEUNCHANGED)
return 1;
/* Must reread both files, because one changed */
ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
cfg = ast_config_load(config, config_flags);
} else {
ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
ucfg = ast_config_load("users.conf", config_flags);
}
==============================
The problem is that if (cfg == CONFIG_STATUS_FILEUNCHANGED) then cfg
pointer must be deallocated before exit or reload config. But no code to do
it.
======================================================================
----------------------------------------------------------------------
(0116427) ddv2005 (reporter) - 2010-01-10 22:07
https://issues.asterisk.org/view.php?id=16574#c116427
----------------------------------------------------------------------
Please close this issue. It is my fault.
Issue History
Date Modified Username Field Change
======================================================================
2010-01-10 22:07 ddv2005 Note Added: 0116427
======================================================================
More information about the asterisk-bugs
mailing list