提交 41a0bc8f authored 作者: Michael Jerris's avatar Michael Jerris

don't deref NULL. Found by Klockwork (www.klocwork.com)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8468 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 5e7e1b99
......@@ -568,12 +568,16 @@ SWITCH_DECLARE(char *) switch_strip_spaces(const char *str)
const char *sp = str;
char *p, *s = NULL;
while(sp && *sp && *sp == ' ') {
if (!sp) return NULL;
while(*sp == ' ') {
sp++;
}
s = strdup(sp);
if (!s) return NULL;
p = s + (strlen(s) - 1);
while(*p == ' ') {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论