diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-04-29 09:11:02 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2013-04-29 14:00:59 +0200 |
commit | d7b22c624bb04e585de4f06a3a32b98f45f7e4b8 (patch) | |
tree | d55fdd0f7461bc401b47a6a1eed99970355c81f5 /openbsc/src/libmsc/smpp_smsc.c | |
parent | 2bc90c274d58a1c1afcd7d8618a7af5e06208039 (diff) |
smpp: Attempt to fix a memory leak of the msgb
The smpp_pdu_rx method does not free the msgb. Introduce an
annotation (currently defined to nothing) to indicate what
will happen to a msgb.
Diffstat (limited to 'openbsc/src/libmsc/smpp_smsc.c')
-rw-r--r-- | openbsc/src/libmsc/smpp_smsc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index f9e517b2b..aaf85212a 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -40,6 +40,7 @@ #include "smpp_smsc.h" #include <openbsc/debug.h> +#include <openbsc/gsm_data.h> /*! \brief Ugly wrapper. libsmpp34 should do this itself! */ #define SMPP34_UNPACK(rc, type, str, data, len) \ @@ -718,7 +719,7 @@ static int smpp_handle_submit(struct osmo_esme *esme, struct msgb *msg) } /*! \brief one complete SMPP PDU from the ESME has been received */ -static int smpp_pdu_rx(struct osmo_esme *esme, struct msgb *msg) +static int smpp_pdu_rx(struct osmo_esme *esme, struct msgb *msg __uses) { uint32_t cmd_id = smpp_msgb_cmdid(msg); int rc = 0; @@ -822,6 +823,7 @@ static int esme_link_read_cb(struct osmo_fd *ofd) if (esme->read_idx >= esme->read_len) { rc = smpp_pdu_rx(esme, esme->read_msg); + msgb_free(esme->read_msg); esme->read_msg = NULL; esme->read_idx = 0; esme->read_len = 0; |