[asterisk-commits] russell: branch 1.4 r66076 -
	/branches/1.4/main/channel.c
    asterisk-commits at lists.digium.com 
    asterisk-commits at lists.digium.com
       
    Thu May 24 15:23:59 MST 2007
    
    
  
Author: russell
Date: Thu May 24 17:23:59 2007
New Revision: 66076
URL: http://svn.digium.com/view/asterisk?view=rev&rev=66076
Log:
if the string field init fails, clean up the stuff that was allocated already
Modified:
    branches/1.4/main/channel.c
Modified: branches/1.4/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/channel.c?view=diff&rev=66076&r1=66075&r2=66076
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Thu May 24 17:23:59 2007
@@ -742,8 +742,11 @@
 		return NULL;
 	}
 	
-	if ((ast_string_field_init(tmp, 128)))
+	if ((ast_string_field_init(tmp, 128))) {
+		sched_context_destroy(tmp->sched);
+		free(tmp);
 		return NULL;
+	}
 
 	/* Don't bother initializing the last two FD here, because they
 	   will *always* be set just a few lines down (AST_TIMING_FD,
    
    
More information about the asterisk-commits
mailing list