]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a memory leak in res_monitor.c
authorMark Michelson <mmichelson@digium.com>
Mon, 23 Mar 2009 17:59:28 +0000 (17:59 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 23 Mar 2009 17:59:28 +0000 (17:59 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@183700 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_monitor.c

index 4baa1580debb93a2d103133b19ca3456ddca876e..69db65cd2037a6f8def9e32833b9b3c30965900f 100644 (file)
@@ -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 = '-';