From 313d207d72477370f2d06e8d5bb8662e7f4d2176 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Mar 2022 09:12:02 +0100 Subject: [PATCH] lib: Slightly simplify add_interface() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source4/lib/socket/interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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;