]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't access the conference structure after it has been freed.
authorJoshua Colp <jcolp@digium.com>
Mon, 11 Dec 2006 04:57:38 +0000 (04:57 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 11 Dec 2006 04:57:38 +0000 (04:57 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48377 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c

index c67d6e94d01f005d7b81ec652cc6c9e5e23f9ba6..5aae656d8a1689633ba492a42a90b3fe87c3895a 100644 (file)
@@ -1927,6 +1927,13 @@ bailoutandtrynormal:
                        conf->markedusers--;
                /* Remove ourselves from the list */
                AST_LIST_REMOVE(&conf->userlist, user, list);
+
+               /* Change any states */
+               if (!conf->users)
+                       ast_device_state_changed("meetme:%s", conf->confno);
+               if (confflags & (CONFFLAG_SLA_STATION|CONFFLAG_SLA_TRUNK))
+                       st_device_state_changed("SLA:%s", conf->confno + 4);
+
                if (AST_LIST_EMPTY(&conf->userlist)) {
                        /* close this one when no more users and no references*/
                        if (!conf->refcount)
@@ -1935,12 +1942,6 @@ bailoutandtrynormal:
                /* Return the number of seconds the user was in the conf */
                snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
                pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
-
-               /* This device changed state now */
-               if (!conf->users)       /* If there are no more members */
-                       ast_device_state_changed("meetme:%s", conf->confno);
-               if (confflags & (CONFFLAG_SLA_STATION|CONFFLAG_SLA_TRUNK))
-                       ast_device_state_changed("SLA:%s", conf->confno + 4);
        }
        free(user);
        AST_LIST_UNLOCK(&confs);