From: Ezra Peisach Date: Tue, 30 Oct 2001 16:14:16 +0000 (+0000) Subject: * fake-addrinfo.c (freeaddrinfo): Do not free NULL pointers X-Git-Tag: krb5-1.3-alpha1~986 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b86ad7c075ffe4e560f7988a0cce47f6f1296604;p=krb5.git * fake-addrinfo.c (freeaddrinfo): Do not free NULL pointers git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13905 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 031741744..b7be66241 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,7 @@ +2001-10-30 Ezra Peisach + + * fake-addrinfo.c (freeaddrinfo): Do not free NULL pointers. + 2001-10-26 Ezra Peisach * k5-int.h: Do not use "usage" in argument names in diff --git a/src/include/fake-addrinfo.c b/src/include/fake-addrinfo.c index 333a6b16c..3ade9dc74 100644 --- a/src/include/fake-addrinfo.c +++ b/src/include/fake-addrinfo.c @@ -263,8 +263,10 @@ void freeaddrinfo (struct addrinfo *ai) struct addrinfo *next; while (ai) { next = ai->ai_next; - free (ai->ai_canonname); - free (ai->ai_addr); + if (ai->ai_canonname) + free (ai->ai_canonname); + if (ai->ai_addr) + free (ai->ai_addr); free (ai); ai = next; }