[asterisk-commits] russell: trunk r38129 - /trunk/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Jul 23 08:21:45 MST 2006


Author: russell
Date: Sun Jul 23 10:21:44 2006
New Revision: 38129

URL: http://svn.digium.com/view/asterisk?rev=38129&view=rev
Log:
ast_malloc is sufficient here, since snprintf is called on the buffer
immediately after it gets allocated, which will automatically NULL terminate
the string

Modified:
    trunk/channel.c

Modified: trunk/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/channel.c?rev=38129&r1=38128&r2=38129&view=diff
==============================================================================
--- trunk/channel.c (original)
+++ trunk/channel.c Sun Jul 23 10:21:44 2006
@@ -515,7 +515,7 @@
 	default:
 		pthread_once(&state2str_buf_once, state2str_buf_key_create);
 		if (!(buf = pthread_getspecific(state2str_buf_key))) {
-			if (!(buf = ast_calloc(1, STATE2STR_BUFSIZE)))
+			if (!(buf = ast_malloc(STATE2STR_BUFSIZE)))
 				return NULL;
 			pthread_setspecific(state2str_buf_key, buf);
 		}



More information about the asterisk-commits mailing list