summaryrefslogtreecommitdiff
path: root/source4/lib/socket
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2022-03-21 09:12:02 +0100
committerJeremy Allison <jra@samba.org>2022-03-23 16:57:28 +0000
commit313d207d72477370f2d06e8d5bb8662e7f4d2176 (patch)
tree8f68dfc8b3ea996d3d40570c19ebb3d271217e8e /source4/lib/socket
parent280e9191cbf8a766e69ab138450f2beccbedd879 (diff)
downloadsamba-313d207d72477370f2d06e8d5bb8662e7f4d2176.tar.gz
lib: Slightly simplify add_interface()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/lib/socket')
-rw-r--r--source4/lib/socket/interface.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/lib/socket/interface.c b/source4/lib/socket/interface.c
index 181893a9e7f..b2dbf226103 100644
--- a/source4/lib/socket/interface.c
+++ b/source4/lib/socket/interface.c
@@ -94,7 +94,11 @@ static void add_interface(TALLOC_CTX *mem_ctx, const struct iface_struct *ifs, s
return;
}
- iface = talloc(*interfaces == NULL ? mem_ctx : *interfaces, struct interface);
+ if (*interfaces != NULL) {
+ mem_ctx = *interfaces;
+ }
+
+ iface = talloc(mem_ctx, struct interface);
if (iface == NULL)
return;