aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-04-30 12:03:07 +0200
committerHarald Welte <laforge@osmocom.org>2021-04-30 12:03:07 +0200
commita25251a15b99aebeaea3879150851473281f9ae8 (patch)
tree4adc2daa036082597f94e626b3ffccb05a2ccbdc
parent9c0fae14d105b64ec9e8ff7322fa4aca782e54d1 (diff)
don't do explicit NULL checks before calling talloc_free()
-rw-r--r--src/osmo_ss7.c6
1 files changed, 2 insertions, 4 deletions
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 @@ static int xua_cli_connect_cb(struct osmo_stream_cli *cli)
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 @@ static int xua_accept_cb(struct osmo_stream_srv_link *link, int fd)
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 */