From 05b9c163edd5b40424bc87af760b62142b837925 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 19 May 2008 22:26:59 +0000 Subject: [PATCH] don't deref NULL. Found by Klockwork (www.klocwork.com) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8482 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_dptools/mod_dptools.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index fed7fb9805..817407178b 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -901,12 +901,14 @@ SWITCH_STANDARD_APP(event_function) for (x = 0; x < argc; x++) { char *p, *this = argv[x]; - p = this; - while(*p == ' ') *p++ = '\0'; - this = p; - if (this) { - char *var = this, *val = NULL; + char *var, *val; + p = this; + while(*p == ' ') *p++ = '\0'; + this = p; + + var = this; + val = NULL; if ((val = strchr(var, '='))) { p = val - 1; *val++ = '\0';