[svn-commits] russell: branch russell/ast_channel_ao2 r184153 - /team/russell/ast_channel_a...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 24 21:12:23 CDT 2009


Author: russell
Date: Tue Mar 24 21:12:20 2009
New Revision: 184153

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=184153
Log:
Fix a potential ref leak and remove a silly comparison

Modified:
    team/russell/ast_channel_ao2/apps/app_directed_pickup.c

Modified: team/russell/ast_channel_ao2/apps/app_directed_pickup.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/ast_channel_ao2/apps/app_directed_pickup.c?view=diff&rev=184153&r1=184152&r2=184153
==============================================================================
--- team/russell/ast_channel_ao2/apps/app_directed_pickup.c (original)
+++ team/russell/ast_channel_ao2/apps/app_directed_pickup.c Tue Mar 24 21:12:20 2009
@@ -169,15 +169,17 @@
 	int res = 0;
 	struct ast_channel *target;
 
-	if (!(target = my_ast_get_channel_by_name_locked(pickup)))
-		return -1;
+	if (!(target = my_ast_get_channel_by_name_locked(pickup))) {
+		return -1;
+	}
 
 	/* Just check that we are not picking up the SAME as target */
-	if (chan->name != target->name && chan != target) {
+	if (chan != target) {
 		res = pickup_do(chan, target);
-		target = ast_channel_unref(target);
-	}
+	}
+
 	ast_channel_unlock(target);
+	target = ast_channel_unref(target);
 
 	return res;
 }




More information about the svn-commits mailing list