[PATCH] openbsc[master]: libbsc: set_net_mcc_mnc_apply: Fix memleak on parsing incorr...

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed Apr 11 10:40:33 UTC 2018


Review at  https://gerrit.osmocom.org/7746

libbsc: set_net_mcc_mnc_apply: Fix memleak on parsing incorrect mcc mnc

Change-Id: I507b0eced7d86f8e978012f6c19f728cd481196b
---
M openbsc/src/libbsc/bsc_ctrl_commands.c
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/46/7746/1

diff --git a/openbsc/src/libbsc/bsc_ctrl_commands.c b/openbsc/src/libbsc/bsc_ctrl_commands.c
index 8b8685a..e6c49d1 100644
--- a/openbsc/src/libbsc/bsc_ctrl_commands.c
+++ b/openbsc/src/libbsc/bsc_ctrl_commands.c
@@ -187,11 +187,13 @@
 
 	if (osmo_mcc_from_str(mcc_str, &plmn.mcc)) {
 		cmd->reply = "Error while decoding MCC";
+		talloc_free(tmp);
 		return CTRL_CMD_ERROR;
 	}
 
 	if (osmo_mnc_from_str(mnc_str, &plmn.mnc, &plmn.mnc_3_digits)) {
 		cmd->reply = "Error while decoding MNC";
+		talloc_free(tmp);
 		return CTRL_CMD_ERROR;
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/7746
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I507b0eced7d86f8e978012f6c19f728cd481196b
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list