summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/smpp_openbsc.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-01-20 17:21:31 +0100
committerHarald Welte <laforge@gnumonks.org>2013-01-20 19:21:48 +0100
commit6a85c15eea537af679cbb61e3fe388ba480625dd (patch)
tree9be2b5ba13d69fe2c60a694c885f05c624754d21 /openbsc/src/libmsc/smpp_openbsc.c
parentb5a4edd09be1b1327cea8cf1b613b5dd35c1aa50 (diff)
smpp: Fix a memleak of the SMS on the submit path
Diffstat (limited to 'openbsc/src/libmsc/smpp_openbsc.c')
-rw-r--r--openbsc/src/libmsc/smpp_openbsc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index 307fc844f..e83fb75e9 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -203,10 +203,11 @@ int handle_smpp_submit(struct osmo_esme *esme, struct submit_sm_t *submit,
case 1: /* datagram */
case 3: /* store-and-forward */
rc = db_sms_store(sms);
+ sms_free(sms);
+ sms = NULL;
if (rc < 0) {
LOGP(DLSMS, LOGL_ERROR, "SMPP SUBMIT-SM: Unable to "
"store SMS in database\n");
- sms_free(sms);
submit_r->command_status = ESME_RSYSERR;
return 0;
}