aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-23 17:59:28 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-23 17:59:28 +0000
commit96ff677092a0812f20005383e29c5c43a4903827 (patch)
treeb2712fc35ccc584cc256e07520189e348c06f1f4 /res
parent74456ce1876d0cf236d931dbaf58d920f81f5b9b (diff)
Fix a memory leak in res_monitor.c
The only way that this leak would occur is if Monitor were started using the Manager interface and no File: header were given. Discovered while reviewing the ast_channel_ao2 review request. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@183700 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_monitor.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c
index 4baa1580d..69db65cd2 100644
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -520,11 +520,7 @@ static int start_monitor_action(struct mansession *s, const struct message *m)
if (ast_strlen_zero(fname)) {
/* No filename base specified, default to channel name as per CLI */
- if (!(fname = ast_strdup(c->name))) {
- astman_send_error(s, m, "Could not start monitoring channel");
- ast_channel_unlock(c);
- return 0;
- }
+ fname = ast_strdupa(c->name);
/* Channels have the format technology/channel_name - have to replace that / */
if ((d = strchr(fname, '/')))
*d = '-';