smpp: Fix a memleak of the SMS on the submit path
diff --git a/openbsc/src/libmsc/smpp_openbsc.c b/openbsc/src/libmsc/smpp_openbsc.c
index 307fc84..e83fb75 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -203,10 +203,11 @@
 	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;
 		}