nbt_server: Make nbtd_mailslot_netlogon_handler a bit more idiomatic
authorVolker Lendecke <vl@samba.org>
Sat, 17 Feb 2018 16:09:31 +0000 (17:09 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 27 Feb 2018 08:14:17 +0000 (09:14 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/nbt_server/dgram/netlogon.c

index 24265d9a4ddbd8a92ad0bbca94bd14c40ec94641..5ed3223ddf275a4265786fb8d73ea27660812334 100644 (file)
@@ -170,15 +170,17 @@ void nbtd_mailslot_netlogon_handler(struct dgram_mailslot_handler *dgmslot,
        NTSTATUS status = NT_STATUS_NO_MEMORY;
        struct nbtd_interface *iface = 
                talloc_get_type(dgmslot->private_data, struct nbtd_interface);
-       struct nbt_netlogon_packet *netlogon = 
-               talloc(dgmslot, struct nbt_netlogon_packet);
+       struct nbt_netlogon_packet *netlogon;
        struct nbtd_interface *reply_iface = nbtd_find_reply_iface(
                iface, src->addr, false);
        struct nbtd_iface_name *iname;
        struct nbt_name *name = &packet->data.msg.dest_name;
        struct nbt_netlogon_response *response;
 
-       if (netlogon == NULL) goto failed;
+       netlogon = talloc(dgmslot, struct nbt_netlogon_packet);
+       if (netlogon == NULL) {
+               goto failed;
+       }
 
        /*
          see if the we are listening on the destination netbios name