[asterisk-commits] trunk - r8393 /trunk/include/asterisk/utils.h
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Jan 21 11:11:41 MST 2006
Author: russell
Date: Sat Jan 21 12:11:40 2006
New Revision: 8393
URL: http://svn.digium.com/view/asterisk?rev=8393&view=rev
Log:
don't do the memcpy inside of ast_strdupa if we know that __builtin_alloca
was not successful
Modified:
trunk/include/asterisk/utils.h
Modified: trunk/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/utils.h?rev=8393&r1=8392&r2=8393&view=diff
==============================================================================
--- trunk/include/asterisk/utils.h (original)
+++ trunk/include/asterisk/utils.h Sat Jan 21 12:11:40 2006
@@ -387,10 +387,6 @@
This macro will duplicate the given string. It returns a pointer to the stack
allocatted memory for the new string.
-
- \note If this function fails to allocate memory on the stack, we do not make
- any effort to prevent Asterisk from crashing. We will attempt to log an
- error message, but Asterisk will crash shortly after.
*/
#define ast_strdupa(s) \
(__extension__ \
@@ -402,7 +398,9 @@
ast_log(LOG_ERROR, "Stack Allocation Error in" \
"function '%s' at line '%d' of '%s'!\n", \
__PRETTY_FUNCTION__, __LINE__, __FILE__); \
- (char *) memcpy (__new, __old, __len); \
+ else \
+ memcpy (__new, __old, __len); \
+ __new; \
}))
#endif
More information about the asterisk-commits
mailing list