]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a bug I found while testing for another issue.
authorJoshua Colp <jcolp@digium.com>
Fri, 30 May 2008 19:46:37 +0000 (19:46 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 30 May 2008 19:46:37 +0000 (19:46 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119354 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/autoservice.c

index b22ea2bc971b6d783abad013e4c09c5c2495f957..a967388cbbb8c261f2afb8d285765c5687bf71c7 100644 (file)
@@ -160,21 +160,20 @@ static void *autoservice_run(void *ign)
                        continue;
                }
 
-               for (i = 0; i < x; i++) {
-                       struct ast_frame *dup_f;
-
-                       if (mons[i] != chan) {
-                               continue;
-                       }
-
-                       if ((dup_f = ast_frdup(f))) {
-                               AST_LIST_INSERT_TAIL(&ents[i]->deferred_frames, dup_f, frame_list);
-                       }
-                       
-                       break;
-               }
-
                if (f) {
+                       for (i = 0; i < x; i++) {
+                               struct ast_frame *dup_f;
+                               
+                               if (mons[i] != chan) {
+                                       continue;
+                               }
+                               
+                               if ((dup_f = ast_frdup(f))) {
+                                       AST_LIST_INSERT_TAIL(&ents[i]->deferred_frames, dup_f, frame_list);
+                               }
+                               
+                               break;
+                       }
                        ast_frfree(f);
                }
        }