Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp()

2018-07-12 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9956 )

Change subject: fix two memleaks in ipa_rx_msg_sccp()
..

fix two memleaks in ipa_rx_msg_sccp()

1: Do not call xua_msg_alloc() which is later bluntly overwritten by
m3ua_xfer_from_data().

2: After dispatching to m3ua_hmdc_rx_from_l2(), call xua_msg_free().

Related: OS#3393
Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
---
M src/ipa.c
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/src/ipa.c b/src/ipa.c
index e15b1d8..f3a7a52 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -202,8 +202,9 @@

 static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg)
 {
+   int rc;
struct m3ua_data_hdr data_hdr;
-   struct xua_msg *xua = xua_msg_alloc();
+   struct xua_msg *xua;
struct osmo_ss7_as *as = find_as_for_asp(asp);
uint32_t opc, dpc;

@@ -263,7 +264,9 @@
m3ua_dh_to_xfer_param(>mtp, _hdr);

/* Pass on as if we had received it from an M3UA ASP */
-   return m3ua_hmdc_rx_from_l2(asp->inst, xua);
+   rc = m3ua_hmdc_rx_from_l2(asp->inst, xua);
+   xua_msg_free(xua);
+   return rc;
 }

 /*! \brief process M3UA message received from socket

--
To view, visit https://gerrit.osmocom.org/9956
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
Gerrit-Change-Number: 9956
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp()

2018-07-11 Thread Neels Hofmeyr
Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/9956

to look at the new patch set (#2).

Change subject: fix two memleaks in ipa_rx_msg_sccp()
..

fix two memleaks in ipa_rx_msg_sccp()

1: Do not call xua_msg_alloc() which is later bluntly overwritten by
m3ua_xfer_from_data().

2: After dispatching to m3ua_hmdc_rx_from_l2(), call xua_msg_free().

Related: OS#3393
Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
---
M src/ipa.c
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/56/9956/2
--
To view, visit https://gerrit.osmocom.org/9956
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
Gerrit-Change-Number: 9956
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp()

2018-07-11 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9956 )

Change subject: fix two memleaks in ipa_rx_msg_sccp()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9956
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
Gerrit-Change-Number: 9956
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 11 Jul 2018 20:04:10 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp()

2018-07-11 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/9956 )

Change subject: fix two memleaks in ipa_rx_msg_sccp()
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/9956
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
Gerrit-Change-Number: 9956
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 11 Jul 2018 14:14:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp()

2018-07-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/9956 )

Change subject: fix two memleaks in ipa_rx_msg_sccp()
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/9956/1/src/ipa.c
File src/ipa.c:

https://gerrit.osmocom.org/#/c/9956/1/src/ipa.c@268
PS1, Line 268:  xua_msg_free(xua);
> Shouldn't upper layers be owning and thus freeing the message?
this is the uppermost layer: the xua_msg gets allocated in 
m3ua_xfer_from_data() above. (maybe you're mixing it up with the msgb? that 
also gets freed here, and is unrelated to the patch)



--
To view, visit https://gerrit.osmocom.org/9956
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
Gerrit-Change-Number: 9956
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Wed, 11 Jul 2018 14:00:13 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp()

2018-07-10 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9956


Change subject: fix two memleaks in ipa_rx_msg_sccp()
..

fix two memleaks in ipa_rx_msg_sccp()

1: Do not call xua_msg_alloc() which is later bluntly overwritten by
m3ua_xfer_from_data().

2: After dispatching to m3ua_hmdc_rx_from_l2(), call xua_msg_free().

Related: OS#3393
Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
---
M src/ipa.c
1 file changed, 5 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/56/9956/1

diff --git a/src/ipa.c b/src/ipa.c
index e15b1d8..f3a7a52 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -202,8 +202,9 @@

 static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg)
 {
+   int rc;
struct m3ua_data_hdr data_hdr;
-   struct xua_msg *xua = xua_msg_alloc();
+   struct xua_msg *xua;
struct osmo_ss7_as *as = find_as_for_asp(asp);
uint32_t opc, dpc;

@@ -263,7 +264,9 @@
m3ua_dh_to_xfer_param(>mtp, _hdr);

/* Pass on as if we had received it from an M3UA ASP */
-   return m3ua_hmdc_rx_from_l2(asp->inst, xua);
+   rc = m3ua_hmdc_rx_from_l2(asp->inst, xua);
+   xua_msg_free(xua);
+   return rc;
 }

 /*! \brief process M3UA message received from socket

--
To view, visit https://gerrit.osmocom.org/9956
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa
Gerrit-Change-Number: 9956
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr