smpp: Fix a memleak of the SMS on the submit path

This commit is contained in:
Holger Hans Peter Freyther 2013-01-20 17:21:31 +01:00 committed by Harald Welte
parent b5a4edd09b
commit 6a85c15eea
1 changed files with 2 additions and 1 deletions

View File

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