[asterisk-commits] rizzo: trunk r48574 - /trunk/apps/app_dial.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Dec 19 02:33:58 MST 2006


Author: rizzo
Date: Tue Dec 19 03:33:57 2006
New Revision: 48574

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48574
Log:
stop what i think is a memory leak in case Dial fails to
connect to a channel.

Before committing to 1.4 i would like some other people to
review and test this fix - thanks.


Modified:
    trunk/apps/app_dial.c

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=48574&r1=48573&r2=48574
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Tue Dec 19 03:33:57 2006
@@ -1295,6 +1295,7 @@
 			handle_cause(cause, &num);
 			if (!rest)	/* we are on the last destination */
 				chan->hangupcause = cause;
+			free(tmp);
 			continue;
 		}
 		pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
@@ -1338,6 +1339,7 @@
 			}
 			if (!tmp->chan) {
 				handle_cause(cause, &num);
+				free(tmp);
 				continue;
 			}
 		}
@@ -1398,6 +1400,7 @@
 				ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
 			ast_hangup(tmp->chan);
 			tmp->chan = NULL;
+			free(tmp);
 			continue;
 		} else {
 			senddialevent(chan, tmp->chan);



More information about the asterisk-commits mailing list