summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-12 13:35:46 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-12 13:38:22 +0200
commit29d58b734d169021bb794d259fa0dde205545bf1 (patch)
tree1b0b50f3524bc03b28b9b6e9f733f79dcda6dda8
parentc9dbe3c7b1fef1a4132a2415d3e74a04591735c9 (diff)
sms: Attempt to plug memory leaks seen at Rhizomatica
Using the talloc leak report we see that there are some msgb's that are allocated for SMS but we don't have transactions or SMS around. We need to improve the name of the messages to uniquely dscribe where they are from but the obvious leak does occur in this routine. The no available transaction id is most likely the case where we leak memory. This should not occur and shows another issue with the smsqueue/smpp handling. It doesn't explain the subscr reference count issue either. Extract of the leak report: GSM 04.11 contains 1160 bytes in 1 blocks (ref 0) 0x2517dc0 GSM 04.11 contains 1160 bytes in 1 blocks (ref 0) 0x24b56e0 GSM 04.11 contains 1160 bytes in 1 blocks (ref 0) 0x23e7930
-rw-r--r--openbsc/src/libmsc/gsm_04_11.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index c2cec26..266cd4d 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -869,6 +869,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
LOGP(DLSMS, LOGL_ERROR, "No available transaction ids\n");
send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, 0);
sms_free(sms);
+ msgb_free(msg);
return -EBUSY;
}
@@ -882,6 +883,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
LOGP(DLSMS, LOGL_ERROR, "No memory for trans\n");
send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, 0);
sms_free(sms);
+ msgb_free(msg);
/* FIXME: send some error message */
return -ENOMEM;
}