Skip to content

Commit

Permalink
[mod_lcr] Fix order_by and sql_stream streams leaking in the case of …
Browse files Browse the repository at this point in the history
…a DB error in lcr_load_config()
  • Loading branch information
andywolk committed Mar 17, 2021
1 parent c282386 commit be6b40b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mod/applications/mod_lcr/mod_lcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down

1 comment on commit be6b40b

@andywolk
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.