[asterisk-commits] seanbright: trunk r304772 - in /trunk: ./ apps/app_meetme.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 29 11:34:26 CST 2011


Author: seanbright
Date: Sat Jan 29 11:34:22 2011
New Revision: 304772

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=304772
Log:
Merged revisions 304730 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r304730 | seanbright | 2011-01-29 12:15:27 -0500 (Sat, 29 Jan 2011) | 22 lines
  
  Merged revisions 304729 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r304729 | seanbright | 2011-01-29 12:01:51 -0500 (Sat, 29 Jan 2011) | 15 lines
    
    Make sure that we unref the correct object when ejecting the most recent caller.
    
    Currently, when we kick the last user to enter, we decrement our own reference
    count which results in a crash when we kick another user or when we exit the
    conference ourselves.
    
    This will fix #18225 in 1.8 and trunk, but that particular bug does not exist in
    1.6.2.
    
    (closes issue #18225)
    Reported by: kenji
    Patches:
          issue18225.patch uploaded by seanbright (license 71)
    Tested by: seanbright
  ........
................

Modified:
    trunk/   (props changed)
    trunk/apps/app_meetme.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_meetme.c?view=diff&rev=304772&r1=304771&r2=304772
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Sat Jan 29 11:34:22 2011
@@ -2206,7 +2206,6 @@
 static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struct ast_flags64 *confflags, char *optargs[])
 {
 	struct ast_conf_user *user = NULL;
-	struct ast_conf_user *usr = NULL;
 	int fd;
 	struct dahdi_confinfo dahdic, dahdic_empty;
 	struct ast_frame *f;
@@ -3222,6 +3221,7 @@
 							int keepplaying;
 							int playednamerec;
 							struct ao2_iterator user_iter;
+							struct ast_conf_user *usr = NULL;
 							switch(dtmf) {
 							case '1': /* *81 Roll call */
 								keepplaying = 1;
@@ -3260,7 +3260,7 @@
 									}
 								}
 								user_iter = ao2_iterator_init(conf->usercontainer, 0);
-								while((user = ao2_iterator_next(&user_iter))) {
+								while((usr = ao2_iterator_next(&user_iter))) {
 									if (ast_fileexists(usr->namerecloc, NULL, NULL)) {
 										if (keepplaying && !ast_streamfile(chan, usr->namerecloc, chan->language)) {
 											res = ast_waitstream(chan, AST_DIGIT_ANY);
@@ -3270,7 +3270,7 @@
 										}
 										playednamerec = 1;
 									}
-									ao2_ref(user, -1);
+									ao2_ref(usr, -1);
 								}
 								ao2_iterator_destroy(&user_iter);
 								if (keepplaying && playednamerec && !ast_streamfile(chan, "conf-roll-callcomplete", chan->language)) {
@@ -3414,6 +3414,7 @@
 								break;
 							case '3': /* Eject last user */
 							{
+								struct ast_conf_user *usr = NULL;
 								int max_no = 0;
 								ao2_callback(conf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
 								menu_active = 0;
@@ -3425,7 +3426,7 @@
 								} else {
 									usr->adminflags |= ADMINFLAG_KICKME;
 								}
-								ao2_ref(user, -1);
+								ao2_ref(usr, -1);
 								ast_stopstream(chan);
 								break;	
 							}




More information about the asterisk-commits mailing list