From 58ea039115f3faaf29529e0df97f4562436fdd09 Mon Sep 17 00:00:00 2001 From: Sean Carey Date: Fri, 15 Feb 2013 23:39:18 +0100 Subject: [PATCH] BUG/MEDIUM: config: fix parser crash with bad bind or server address If an address is improperly formated on a bind or server address and haproxy is built for using getaddrinfo, then a crash may occur upon the call to freeaddrinfo(). Thanks to Jon Meredith for helping me patch this for SmartOS, I am not a C/GDB wizard. --- src/standard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/standard.c b/src/standard.c index b14b70ba2..380f7bedc 100644 --- a/src/standard.c +++ b/src/standard.c @@ -600,7 +600,8 @@ struct sockaddr_storage *str2ip(const char *str) } } - freeaddrinfo(result); + if (result) + freeaddrinfo(result); } #endif /* unsupported address family */