[asterisk-commits] russell: branch 1.4 r67372 - /branches/1.4/main/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jun 5 10:07:31 MST 2007


Author: russell
Date: Tue Jun  5 12:07:30 2007
New Revision: 67372

URL: http://svn.digium.com/view/asterisk?view=rev&rev=67372
Log:
Handle a failure in malloc() in ast_safe_string_alloc()

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=67372&r1=67371&r2=67372
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Tue Jun  5 12:07:30 2007
@@ -435,7 +435,8 @@
 	len = vsnprintf(buf, 1, fmt, args);
 	va_end(args);
 
-	b2 = ast_malloc(len + 1);
+	if (!(b2 = ast_malloc(len + 1)))
+		return NULL;
 
 	va_start(args, fmt);
 	vsnprintf(b2, len + 1,  fmt, args);



More information about the asterisk-commits mailing list