From 103dfc02cb10afb7ca368b1c20e2bcef744357ff Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 21 May 2008 20:25:40 +0000 Subject: [PATCH] handle allocation error. Found by Klockwork (www.klocwork.com) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8508 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_play_say.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index c157538ce7..000ae7e1c9 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1386,6 +1386,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session char *tp; switch_size_t mylen = strlen(text) + extra + 1; tmp = malloc(mylen); + if (!tmp) { + return SWITCH_STATUS_MEMERR; + } memset(tmp, 0, mylen); tp = tmp; for (p = text; p && *p; p++) {