summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-10-04 02:01:05 +0200
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-10-04 02:05:47 +0200
commit7a72f64dc62fddc19628bc23b960d719644d45f9 (patch)
treec859af2d74d8df00e090ec565bb0c5a1a1dbc214
parent89b43c45f4694ae9b757b9a00ac30c8bd2dc5f77 (diff)
Slight clean up of the code in gsm340_rx_tpdu() and a fix for an unlikely, but possible memory leak there.
-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) {