s3: Fix return check in nss_wins
authorVolker Lendecke <vl@samba.org>
Sun, 15 May 2011 21:26:10 +0000 (23:26 +0200)
committerVolker Lendecke <vlendec@samba.org>
Sun, 15 May 2011 22:30:42 +0000 (00:30 +0200)
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon May 16 00:30:42 CEST 2011 on sn-devel-104

nsswitch/wins.c

index e0aa2ad8f55b77c2ee8243111c52aedc090fa0e1..f5fd7a775e773e5374665bb1160ee4e585ec10f8 100644 (file)
@@ -99,7 +99,7 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count)
                in_addr_to_sockaddr_storage(&ss, *bcast);
                status = name_query(name, 0x00, True, True, &ss,
                                    NULL, &pss, count, NULL);
-               if (pss) {
+               if (NT_STATUS_IS_OK(status) && (*count > 0)) {
                        if ((ret = SMB_MALLOC_P(struct in_addr)) == NULL) {
                                return NULL;
                        }