From 6a85c15eea537af679cbb61e3fe388ba480625dd Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 20 Jan 2013 17:21:31 +0100 Subject: smpp: Fix a memleak of the SMS on the submit path --- openbsc/src/libmsc/smpp_openbsc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openbsc') 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; } -- cgit v1.2.3