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
This commit is contained in:
Holger Hans Peter Freyther 2015-08-12 13:35:46 +02:00
parent c9dbe3c7b1
commit 29d58b734d
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}