am 857e1124: am e6594658: am 8623dc75: Merge "Fix freeaddrinfo(NULL)."
* commit '857e1124433a4946bc38f427d390ef39a2f083b1': Fix freeaddrinfo(NULL).
This commit is contained in:
commit
3db10f76a1
@ -324,7 +324,11 @@ freeaddrinfo(struct addrinfo *ai)
|
|||||||
{
|
{
|
||||||
struct addrinfo *next;
|
struct addrinfo *next;
|
||||||
|
|
||||||
assert(ai != NULL);
|
#if __ANDROID__
|
||||||
|
if (ai == NULL) return;
|
||||||
|
#else
|
||||||
|
_DIAGASSERT(ai != NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
do {
|
do {
|
||||||
next = ai->ai_next;
|
next = ai->ai_next;
|
||||||
|
@ -23,6 +23,11 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
// https://code.google.com/p/android/issues/detail?id=13228
|
||||||
|
TEST(netdb, freeaddrinfo_NULL) {
|
||||||
|
freeaddrinfo(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
TEST(netdb, getaddrinfo_NULL_host) {
|
TEST(netdb, getaddrinfo_NULL_host) {
|
||||||
// It's okay for the host argument to be NULL, as long as service isn't.
|
// It's okay for the host argument to be NULL, as long as service isn't.
|
||||||
addrinfo* ai = NULL;
|
addrinfo* ai = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user