add switch_safe_strdup

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9497 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-09-09 22:47:03 +00:00
parent 432da6e071
commit 4abd35c5a0

View File

@ -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