]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11785 [mod_httapi] Fix dead assignment and null pointer false positive
authorChris Rienzo <chris@signalwire.com>
Thu, 2 May 2019 23:52:01 +0000 (23:52 +0000)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Jul 2019 17:50:29 +0000 (21:50 +0400)
src/mod/applications/mod_httapi/mod_httapi.c

index 0b15ec5d7debf9f8902f0dfd7dbfc430a97ec596..a2c63703c6439e579e1f04c8fdece5956cf92656 100644 (file)
@@ -955,8 +955,6 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
        const char *sub_action = NULL;
        const char *digit_timeout_ = switch_xml_attr(tag, "digit-timeout");
        const char *terminators = switch_xml_attr(tag, "terminators");
-       char *loops_ = (char *) switch_xml_attr(tag, "loops");
-       int loops = 0;
        switch_status_t status = SWITCH_STATUS_SUCCESS;
        switch_ivr_dmachine_t *dmachine = NULL;
        switch_input_args_t *args = NULL, myargs = { 0 };
@@ -991,6 +989,7 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
                }
        }
 
+       switch_assert(fname != NULL);
        if ((p = strrchr(fname, '.'))) {
                *p++ = '\0';
                ext = p;
@@ -1028,14 +1027,6 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
                }
        }
 
-       if (loops_) {
-               loops = atoi(loops_);
-
-               if (loops < 0) {
-                       loops = -1;
-               }
-       }
-
        if (digit_timeout_) {
                tmp = atol(digit_timeout_);