]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't deref NULL. Found by Klockwork (www.klocwork.com)
authorMichael Jerris <mike@jerris.com>
Mon, 19 May 2008 22:26:59 +0000 (22:26 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 19 May 2008 22:26:59 +0000 (22:26 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8482 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_dptools/mod_dptools.c

index fed7fb9805c70bd9647b2ba92f09fae25be17336..817407178bce398de4d3cc12cc802eaae8577a39 100644 (file)
@@ -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';