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.
diff --git a/src/standard.c b/src/standard.c
index b14b70b..380f7be 100644
--- a/src/standard.c
+++ b/src/standard.c
@@ -600,7 +600,8 @@
}
}
- freeaddrinfo(result);
+ if (result)
+ freeaddrinfo(result);
}
#endif
/* unsupported address family */