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

libbsc: set_net_mcc_mnc_apply: Fix memleak on parsing incorrect mcc mnc

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/47/7747/1

diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c
index 64f4589..171feaf 100644
--- a/src/libbsc/bsc_ctrl_commands.c
+++ b/src/libbsc/bsc_ctrl_commands.c
@@ -149,11 +149,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/7747
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43513e108dfba24efb091d56b3fdfdb0cd0af727
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>

Reply via email to