mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
subscr: Fix subscr refcount issue in case of message error
In case the SMPP payload didn't include the right fields we would leak the subscr reference count.
This commit is contained in:
@@ -110,6 +110,7 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
|
|||||||
/* ERROR: we cannot have both! */
|
/* ERROR: we cannot have both! */
|
||||||
LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in "
|
LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in "
|
||||||
"TLV _and_ in the header\n");
|
"TLV _and_ in the header\n");
|
||||||
|
subscr_put(dest);
|
||||||
return ESME_ROPTPARNOTALLWD;
|
return ESME_ROPTPARNOTALLWD;
|
||||||
}
|
}
|
||||||
sms_msg = t->value.octet;
|
sms_msg = t->value.octet;
|
||||||
@@ -120,6 +121,7 @@ static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
|
|||||||
} else {
|
} else {
|
||||||
LOGP(DLSMS, LOGL_ERROR,
|
LOGP(DLSMS, LOGL_ERROR,
|
||||||
"SMPP neither message payload nor valid sm_length.\n");
|
"SMPP neither message payload nor valid sm_length.\n");
|
||||||
|
subscr_put(dest);
|
||||||
return ESME_RINVPARLEN;
|
return ESME_RINVPARLEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user