[PATCH] Attempt to fix Coverity ID 595

Volker Lendecke vl at sernet.de
Sat Aug 16 09:17:09 GMT 2008


is_ipaddress already dereferences "name", so the NULL check is pointless after
calling it.
---
 source/libcli/nbt/nbtname.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/source/libcli/nbt/nbtname.c b/source/libcli/nbt/nbtname.c
index 2025ef7..fbb9550 100644
--- a/source/libcli/nbt/nbtname.c
+++ b/source/libcli/nbt/nbtname.c
@@ -420,7 +420,7 @@ _PUBLIC_ void nbt_choose_called_name(TALLOC_CTX *mem_ctx,
 	n->scope = NULL;
 	n->type = type;
 
-	if (is_ipaddress(name) || name == NULL) {
+	if ((name == NULL) || is_ipaddress(name)) {
 		n->name = "*SMBSERVER";
 		return;
 	}
-- 
1.5.5



More information about the samba-technical mailing list