From b86ad7c075ffe4e560f7988a0cce47f6f1296604 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Tue, 30 Oct 2001 16:14:16 +0000 Subject: [PATCH] * fake-addrinfo.c (freeaddrinfo): Do not free NULL pointers git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13905 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 4 ++++ src/include/fake-addrinfo.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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; } -- 2.26.2