]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11785 [mod_expr] fix scan-build false positives
authorChris Rienzo <chris@signalwire.com>
Tue, 23 Apr 2019 02:55:08 +0000 (02:55 +0000)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 17:49:12 +0000 (21:49 +0400)
src/mod/applications/mod_expr/exprpars.c

index 25e66b8e32f3a1a9d488192d45da045ffc23ae6a..10396ff244456e9e6cb114ce7b009e85e7f0ee51 100644 (file)
@@ -1266,7 +1266,7 @@ int exprInternalParseFunction(exprObj * obj, exprNode * node, exprToken * tokens
                                                        }
 
                                                        /* Set reference item */
-                                                       reftmp[refcur] = addr;
+                                                       if (reftmp) reftmp[refcur] = addr; // the 'if' shuts up scan-build
 
                                                        /* increase ref arg number and lv position */
                                                        refcur++;
@@ -1330,7 +1330,7 @@ int exprInternalParseFunction(exprObj * obj, exprNode * node, exprToken * tokens
                        }
 
                        /* Set reference item */
-                       reftmp[refcur] = addr;
+                       if (reftmp) reftmp[refcur] = addr; // the 'if' shuts up scan-build
                } else {
                        err = exprInternalParse(obj, &(tmp[cur]), tokens, lv, p2 - 1);
                        if (err != EXPR_ERROR_NOERROR)