[Freeswitch-svn] [commit] r9497 - freeswitch/trunk/src/include
Freeswitch SVN
anthm at freeswitch.org
Tue Sep 9 18:47:04 EDT 2008
Author: anthm
Date: Tue Sep 9 18:47:03 2008
New Revision: 9497
Modified:
freeswitch/trunk/src/include/switch_utils.h
Log:
add switch_safe_strdup
Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h (original)
+++ freeswitch/trunk/src/include/switch_utils.h Tue Sep 9 18:47:03 2008
@@ -285,6 +285,15 @@
*/
#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
More information about the Freeswitch-svn
mailing list