From: Volker Lendecke Date: Mon, 21 Mar 2022 08:12:02 +0000 (+0100) Subject: lib: Slightly simplify add_interface() X-Git-Tag: tevent-0.12.0~349 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=313d207d72477370f2d06e8d5bb8662e7f4d2176;p=thirdparty%2Fsamba.git lib: Slightly simplify add_interface() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- 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;