[asterisk-commits] dlee: branch dlee/record-controls r395335 - /team/dlee/record-controls/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 24 16:41:35 CDT 2013


Author: dlee
Date: Wed Jul 24 16:41:33 2013
New Revision: 395335

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395335
Log:
Fixed frame double-free

Modified:
    team/dlee/record-controls/main/app.c

Modified: team/dlee/record-controls/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record-controls/main/app.c?view=diff&rev=395335&r1=395334&r2=395335
==============================================================================
--- team/dlee/record-controls/main/app.c (original)
+++ team/dlee/record-controls/main/app.c Wed Jul 24 16:41:33 2013
@@ -1472,17 +1472,18 @@
 					break;
 				}
 			} else if (f->frametype == AST_FRAME_CONTROL) {
-				switch (f->subclass.integer) {
-				case AST_CONTROL_RECORD_CANCEL:
+				if (f->subclass.integer == AST_CONTROL_RECORD_CANCEL) {
 					ast_verb(3, "Message canceled by control\n");
 					running = 0;
 					outmsg = 0; /* cancels the recording */
+					res = 0;
 					break;
-				case AST_CONTROL_RECORD_STOP:
+				} else if (f->subclass.integer == AST_CONTROL_RECORD_STOP) {
 					ast_verb(3, "Message ended by control\n");
 					running = 0;
+					res = 0;
 					break;
-				case AST_CONTROL_RECORD_SUSPEND:
+				} else if (f->subclass.integer == AST_CONTROL_RECORD_SUSPEND) {
 					paused = !paused;
 					ast_verb(3, "Message %spaused by control\n",
 						paused ? "" : "un");
@@ -1491,8 +1492,7 @@
 					} else {
 						paused_secs += time(NULL) - pause_start;
 					}
-					break;
-				case AST_CONTROL_RECORD_MUTE:
+				} else if (f->subclass.integer == AST_CONTROL_RECORD_MUTE) {
 					muted = !muted;
 					ast_verb(3, "Message %smuted by control\n",
 						muted ? "" : "un");
@@ -1508,7 +1508,6 @@
 							running = 0;
 						}
 					}
-					break;
 				}
 			}
 			if (maxtime && !paused) {




More information about the asterisk-commits mailing list