virGetHostnameLocalhost: avoid FP NULL-ptr-deref from clang

* src/util/util.c (virGetHostnameLocalhost): Add an sa_assert
to tell clang it's ok to dereference "info" after a non-failing
getaddrinfo call.
This commit is contained in:
Jim Meyering 2010-04-07 17:23:24 +02:00
parent b6719eab9e
commit 6e2f811443

View File

@ -2394,6 +2394,9 @@ char *virGetHostnameLocalhost(int allow_localhost)
return NULL;
}
/* Tell static analyzers about getaddrinfo semantics. */
sa_assert (info);
/* if we aren't allowing localhost, then we iterate through the
* list and make sure none of the IPv4 addresses are 127.0.0.1 and
* that none of the IPv6 addresses are ::1