mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-26 20:48:21 +00:00
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:
parent
432da6e071
commit
4abd35c5a0
@ -285,6 +285,15 @@ switch_mutex_unlock(obj->flag_mutex);
|
|||||||
*/
|
*/
|
||||||
#define switch_safe_free(it) if (it) {free(it);it=NULL;}
|
#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
|
\brief Test if one string is inside another with extra case checking
|
||||||
|
Loading…
x
Reference in New Issue
Block a user