]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_spandsp] scan-build: Argument with 'nonnull' attribute passed null in modem_init()
authorAndrey Volk <andywolk@gmail.com>
Fri, 26 Feb 2021 18:44:30 +0000 (21:44 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 19 Oct 2021 17:15:58 +0000 (20:15 +0300)
src/mod/applications/mod_spandsp/mod_spandsp_modem.c

index 5613b4aa4c6899443856c6ef41fd1649118becf1..560a78be444c30f706933063dc53fe096fc5e20e 100644 (file)
@@ -279,11 +279,11 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl
        modem->stty = ptsname(modem->master);
        if (modem->stty == NULL) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Fatal error: failed to obtain slave pty filename\n");
-       }
-
-       modem->slave = open(modem->stty, O_RDWR);
-       if (modem->slave < 0) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Fatal error: failed to open slave pty %s\n", modem->stty);
+       } else {
+               modem->slave = open(modem->stty, O_RDWR);
+               if (modem->slave < 0) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Fatal error: failed to open slave pty %s\n", modem->stty);
+               }
        }
 #endif