This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged.
Change subject: bsc_nat: ctrl: fix memleak on reply receival
......................................................................
bsc_nat: ctrl: fix memleak on reply receival
Change-Id: I146c4a561b0cd62779d60da3b55b96e24438bd89
---
M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
1 file changed, 3 insertions(+), 4 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
index 128ea65..738ac87 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
@@ -102,7 +102,7 @@
{
struct ctrl_cmd *cmd;
struct bsc_cmd_list *pending;
- char *var, *id;
+ char *var;
cmd = ctrl_cmd_parse(bsc, msg);
msgb_free(msg);
@@ -142,13 +142,12 @@
/* Find the pending command */
pending = bsc_get_pending(bsc, cmd->id);
if (pending) {
- id = talloc_strdup(cmd, pending->cmd->id);
- if (!id) {
+ osmo_talloc_replace_string(cmd, &cmd->id, pending->cmd->id);
+ if (!cmd->id) {
cmd->type = CTRL_TYPE_ERROR;
cmd->reply = "OOM";
goto err;
}
- cmd->id = id;
ctrl_cmd_send(&pending->ccon->write_queue, cmd);
bsc_nat_ctrl_del_pending(pending);
} else {
--
To view, visit https://gerrit.osmocom.org/7749
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I146c4a561b0cd62779d60da3b55b96e24438bd89
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder