lib: Slightly simplify add_interface()
authorVolker Lendecke <vl@samba.org>
Mon, 21 Mar 2022 08:12:02 +0000 (09:12 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 23 Mar 2022 16:57:28 +0000 (16:57 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/lib/socket/interface.c

index 181893a9e7fcbad8e95b20ff4a0b500b59f169bd..b2dbf2261037df90bf80cb3bd969ba67dc394da6 100644 (file)
@@ -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;