summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_11.c
diff options
context:
space:
mode:
authorAlexander Chemeris <alexander.chemeris@gmail.com>2013-10-04 02:42:27 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-04 08:18:32 +0200
commit4ad593c8f636ba566f914c086287c43bb75ed7f8 (patch)
tree36ab12516468b834fd596400c307a9551cdd7e18 /openbsc/src/libmsc/gsm_04_11.c
parenta3d41c91242fe253215afb66e87d3a905ac02dfe (diff)
sms: Possiqble meamleak fix gsm340_rx_tpdu()
Slight clean up of the code in gsm340_rx_tpdu() and a fix for an unlikely, but possible memory leak there.
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_11.c')
-rw-r--r--openbsc/src/libmsc/gsm_04_11.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 2fc250bc8..e554b7401 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -337,8 +337,8 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
sms_alphabet = gsm338_get_sms_alphabet(gsms->data_coding_scheme);
if (sms_alphabet == 0xffffffff) {
- sms_free(gsms);
- return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
+ rc = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
+ goto out;
}
switch (sms_vpf) {
@@ -359,7 +359,8 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
default:
LOGP(DLSMS, LOGL_NOTICE,
"SMS Validity period not implemented: 0x%02x\n", sms_vpf);
- return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
+ rc = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
+ goto out;
}
gsms->user_data_len = *smsp++;
if (gsms->user_data_len) {