[Asterisk-code-review] cdr raidus,cel radius: Fix old memleak in unload (asterisk[11])
Badalian Vyacheslav
asteriskteam at digium.com
Mon Oct 10 13:04:10 CDT 2016
Badalian Vyacheslav has uploaded a new change for review.
https://gerrit.asterisk.org/4062
Change subject: cdr_raidus,cel_radius: Fix old memleak in unload
......................................................................
cdr_raidus,cel_radius: Fix old memleak in unload
- Call "rc_openlog" optional. If you do not call,
you will simply NULL instead of a name.
- On the one PID can be only one syslog channel.
And it can already be run in logger.c
- Calling rc_openlog we assigns a new name for
the channel syslog. This unexpected behavior for logger.c.
Most lesser evil, is to agree on a NULL name syslog
if the channel was not launched in logger.c.
It also solves the problem of memory leaks.
ASTERISK-26455 #close
Change-Id: Ic17c38de67583e971d78fe18807d1a9faf8f0afd
---
M cdr/cdr_radius.c
M cel/cel_radius.c
2 files changed, 0 insertions(+), 24 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/62/4062/1
diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c
index fc28860..bdac487 100644
--- a/cdr/cdr_radius.c
+++ b/cdr/cdr_radius.c
@@ -256,18 +256,6 @@
} else
return AST_MODULE_LOAD_DECLINE;
- /*
- * start logging
- *
- * NOTE: Yes this causes a slight memory leak if the module is
- * unloaded. However, it is better than a crash if cdr_radius
- * and cel_radius are both loaded.
- */
- tmp = ast_strdup("asterisk");
- if (tmp) {
- rc_openlog((char *) tmp);
- }
-
/* read radiusclient-ng config file */
if (!(rh = rc_read_config(radiuscfg))) {
ast_log(LOG_NOTICE, "Cannot load radiusclient-ng configuration file %s.\n", radiuscfg);
diff --git a/cel/cel_radius.c b/cel/cel_radius.c
index db0acfb..c80d502 100644
--- a/cel/cel_radius.c
+++ b/cel/cel_radius.c
@@ -238,18 +238,6 @@
return AST_MODULE_LOAD_DECLINE;
}
- /*
- * start logging
- *
- * NOTE: Yes this causes a slight memory leak if the module is
- * unloaded. However, it is better than a crash if cdr_radius
- * and cel_radius are both loaded.
- */
- tmp = ast_strdup("asterisk");
- if (tmp) {
- rc_openlog((char *) tmp);
- }
-
/* read radiusclient-ng config file */
if (!(rh = rc_read_config(radiuscfg))) {
ast_log(LOG_NOTICE, "Cannot load radiusclient-ng configuration file %s.\n", radiuscfg);
--
To view, visit https://gerrit.asterisk.org/4062
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic17c38de67583e971d78fe18807d1a9faf8f0afd
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Badalian Vyacheslav <v.badalyan at open-bs.ru>
More information about the asterisk-code-review
mailing list