[asterisk-commits] mmichelson: trunk r220995 - /trunk/main/cel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 29 16:28:08 CDT 2009


Author: mmichelson
Date: Tue Sep 29 16:28:04 2009
New Revision: 220995

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=220995
Log:
Fix channel reference leak.

ast_cel_report_event would geet a reference to the
bridged channel. However, certain return paths, such
as if CEL was not enabled, would result in a reference
leak. All return paths now properly unref the channel.

(closes issue #15991)
Reported by: mmichelson


Modified:
    trunk/main/cel.c

Modified: trunk/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cel.c?view=diff&rev=220995&r1=220994&r2=220995
==============================================================================
--- trunk/main/cel.c (original)
+++ trunk/main/cel.c Tue Sep 29 16:28:04 2009
@@ -483,6 +483,9 @@
 
 	if (!cel_enabled || !ast_cel_track_event(event_type)) {
 		ast_mutex_unlock(&reload_lock);
+		if (peer) {
+			ast_channel_unref(peer);
+		}
 		return 0;
 	}
 
@@ -490,6 +493,9 @@
 		char *app;
 		if (!(app = ao2_find(appset, (char *) chan->appl, OBJ_POINTER))) {
 			ast_mutex_unlock(&reload_lock);
+			if (peer) {
+				ast_channel_unref(peer);
+			}
 			return 0;
 		}
 		ao2_ref(app, -1);




More information about the asterisk-commits mailing list