aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-04-09 23:58:55 +0200
committerVadim Yanitskiy <axilirator@gmail.com>2019-04-10 10:53:23 +0000
commit5dede769e7288e04d8612f6e380ca297981471e1 (patch)
treeb96044a3ff13b6392b51cd0661dc0e2ca62f866b /src/libmsc
parentf8af776fbac9c98d6b860a71afbff7caa474352d (diff)
smpp_smsc: Call destroy_tlv() when using build_tlv()
The libsmpp34 build_tlv() function is allocating dynamic memory which we need to release again by calling destroy_tlv(). Change-Id: Iacc74c9948fb10fa79c0dd7b0cb72d4adbefdeed Closes: OS#3912
Diffstat (limited to 'src/libmsc')
-rw-r--r--src/libmsc/smpp_smsc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c
index 2350d84..3bfb81a 100644
--- a/src/libmsc/smpp_smsc.c
+++ b/src/libmsc/smpp_smsc.c
@@ -520,7 +520,9 @@ static int smpp_handle_bind_tx(struct osmo_esme *esme, struct msgb *msg)
tlv.value.val16 = esme->smpp_version;
build_tlv(&bind_r.tlv, &tlv);
- return PACK_AND_SEND(esme, &bind_r);
+ rc = PACK_AND_SEND(esme, &bind_r);
+ destroy_tlv(bind_r.tlv);
+ return rc;
}
/*! \brief handle an incoming SMPP BIND TRANSCEIVER */
@@ -632,6 +634,7 @@ int smpp_tx_alert(struct osmo_esme *esme, uint8_t ton, uint8_t npi,
{
struct alert_notification_t alert;
struct tlv_t tlv;
+ int rc;
memset(&alert, 0, sizeof(alert));
alert.command_length = 0;
@@ -652,7 +655,9 @@ int smpp_tx_alert(struct osmo_esme *esme, uint8_t ton, uint8_t npi,
alert.source_addr_npi,
get_value_string(smpp_avail_strs, avail_status));
- return PACK_AND_SEND(esme, &alert);
+ rc = PACK_AND_SEND(esme, &alert);
+ destroy_tlv(alert.tlv);
+ return rc;
}
/* \brief send a DELIVER-SM message to given ESME */