Change in libosmo-sccp[master]: don't do explicit NULL checks before calling talloc_free()

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


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/23989 )

Change subject: don't do explicit NULL checks before calling talloc_free()
......................................................................

don't do explicit NULL checks before calling talloc_free()

Change-Id: I97a072ca32820ad34785ac6a54b00ed51b519305
---
M src/osmo_ss7.c
1 file changed, 2 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index de072b4..6d68290 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1734,8 +1734,7 @@
 	struct osmo_ss7_asp *asp = osmo_stream_cli_get_data(cli);
 
 	/* update the socket name */
-	if (asp->sock_name)
-		talloc_free(asp->sock_name);
+	talloc_free(asp->sock_name);
 	asp->sock_name = osmo_sock_get_name(asp, ofd->fd);
 
 	LOGPASP(asp, DLSS7, LOGL_INFO, "Client connected %s\n", asp->sock_name);
@@ -1987,8 +1986,7 @@
 	asp->server = srv;
 	asp->xua_server = oxs;
 	/* update the ASP socket name */
-	if (asp->sock_name)
-		talloc_free(asp->sock_name);
+	talloc_free(asp->sock_name);
 	asp->sock_name = talloc_reparent(link, asp, sock_name);
 	/* make sure the conn_cb() is called with the asp as private
 	 * data */

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I97a072ca32820ad34785ac6a54b00ed51b519305
Gerrit-Change-Number: 23989
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210430/f3c6cbca/attachment.htm>


More information about the gerrit-log mailing list