Change in libosmo-sccp[master]: osmo_ss7: free the sock_name string once an ASP socket is closed

laforge gerrit-no-reply at lists.osmocom.org
Fri Apr 30 10:07:29 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/23990 )


Change subject: osmo_ss7: free the sock_name string once an ASP socket is closed
......................................................................

osmo_ss7: free the sock_name string once an ASP socket is closed

It's confusing to keep around a string representation of what peer the
socket was previously connected to.

Change-Id: I00d47fc355bfe24915653767ad75c1f491c060d5
---
M src/osmo_ss7.c
1 file changed, 8 insertions(+), 0 deletions(-)



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

diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 6d68290..617f6bb 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1759,6 +1759,10 @@
 	osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_SCTP_COMM_DOWN_IND, asp);
 	/* send M-SCTP_RELEASE.ind to XUA Layer Manager */
 	xua_asp_send_xlm_prim_simple(asp, OSMO_XLM_PRIM_M_SCTP_RELEASE, PRIM_OP_INDICATION);
+
+	/* no connection means no socket means no socket name */
+	talloc_free(asp->sock_name);
+	asp->sock_name = NULL;
 }
 
 static void xua_cli_close_and_reconnect(struct osmo_stream_cli *cli)
@@ -1892,6 +1896,10 @@
 		osmo_ss7_asp_destroy(asp);
 	}
 
+	/* no connection means no socket means no socket name */
+	talloc_free(asp->sock_name);
+	asp->sock_name = NULL;
+
 	return 0;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/23990
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I00d47fc355bfe24915653767ad75c1f491c060d5
Gerrit-Change-Number: 23990
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210430/4f9b610b/attachment.htm>


More information about the gerrit-log mailing list