]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_lcr] Fix order_by and sql_stream streams leaking in the case of a DB error in...
authorAndrey Volk <andywolk@gmail.com>
Thu, 21 Jan 2021 15:43:02 +0000 (18:43 +0300)
committerAndrey Volk <andywolk@gmail.com>
Wed, 17 Mar 2021 16:20:41 +0000 (19:20 +0300)
src/mod/applications/mod_lcr/mod_lcr.c

index a9adb3db1072d029f1baeb39d501d4c92049ec64..ab7c163ce5a698c22fba75ad239c0d8ea9b7e6ce 100644 (file)
@@ -1186,6 +1186,8 @@ static switch_status_t lcr_load_config()
                                                if (db_check("ALTER TABLE carrier_gateway add codec varchar(255);") == SWITCH_TRUE) {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "adding codec field your lcr carrier_gateway database schema.\n");
                                                } else {
+                                                       switch_safe_free(order_by.data);
+                                                       switch_safe_free(sql_stream.data);
                                                        switch_goto_status(SWITCH_STATUS_FALSE, done);
                                                }
                                        }
@@ -1197,6 +1199,8 @@ static switch_status_t lcr_load_config()
                                                if (db_check("ALTER TABLE lcr add cid varchar(32);") == SWITCH_TRUE) {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "adding cid field to your lcr database schema.\n");
                                                } else {
+                                                       switch_safe_free(order_by.data);
+                                                       switch_safe_free(sql_stream.data);
                                                        switch_goto_status(SWITCH_STATUS_FALSE, done);
                                                }
                                        }
@@ -1205,6 +1209,8 @@ static switch_status_t lcr_load_config()
                                                if (db_check("ALTER TABLE lcr ADD lrn BOOLEAN NOT NULL DEFAULT false")) {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "adding lrn field to your lcr database schema.\n");
                                                } else {
+                                                       switch_safe_free(order_by.data);
+                                                       switch_safe_free(sql_stream.data);
                                                        switch_goto_status(SWITCH_STATUS_FALSE, done);
                                                }
                                        }