提交 4abd35c5 authored 作者: Anthony Minessale's avatar Anthony Minessale

add switch_safe_strdup

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9497 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 432da6e0
......@@ -285,6 +285,15 @@ switch_mutex_unlock(obj->flag_mutex);
*/
#define switch_safe_free(it) if (it) {free(it);it=NULL;}
static inline char *switch_safe_strdup(const char *it)
{
if (it) {
return strdup(it);
}
return NULL;
}
/*!
\brief Test if one string is inside another with extra case checking
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论