From be19275578af687b907aa65ead2d0172a83f757f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 28 Dec 2005 17:11:47 +0000 Subject: [PATCH] git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@224 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/switch_core.c b/src/switch_core.c index 1abaaf158b..81fa086401 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -526,6 +526,8 @@ SWITCH_DECLARE(char *) switch_core_permenant_strdup(char *todup) assert(runtime.memory_pool != NULL); + if (!todup) return NULL; + len = strlen(todup) + 1; if (todup && (duped = apr_palloc(runtime.memory_pool, len))) { strncpy(duped, todup, len); @@ -541,6 +543,8 @@ SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session *session, assert(session != NULL); assert(session->pool != NULL); + if (!todup) return NULL; + len = strlen(todup) + 1; if (todup && (duped = apr_palloc(session->pool, len))) { @@ -557,6 +561,7 @@ SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup) assert(pool != NULL); assert(todup != NULL); + if (!todup) return NULL; len = strlen(todup) + 1; if (todup && (duped = apr_palloc(pool, len))) {