From 50cc510584f0a97175c563a96bd641ead874dc93 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 1 Jan 2014 17:56:30 +0100 Subject: [PATCH] libreplace: free() deals fine with NULL pointers Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/replace/getaddrinfo.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/replace/getaddrinfo.c b/lib/replace/getaddrinfo.c index c5cd52be93c..8440d8e6f3e 100644 --- a/lib/replace/getaddrinfo.c +++ b/lib/replace/getaddrinfo.c @@ -321,12 +321,8 @@ void rep_freeaddrinfo(struct addrinfo *res) for (;res; res = next) { next = res->ai_next; - if (res->ai_canonname) { - free(res->ai_canonname); - } - if (res->ai_addr) { - free(res->ai_addr); - } + free(res->ai_canonname); + free(res->ai_addr); free(res); } } -- 2.11.4.GIT