From: Adam Dickmeiss Date: Thu, 3 Dec 2009 12:36:29 +0000 (+0100) Subject: Fix uninit-var bug in tcpip_straddr. X-Git-Tag: v4.0.0~92^2~2 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=ee12d78cea5ed5f277f869151a918c8b606887e4;p=yaz-moved-to-github.git Fix uninit-var bug in tcpip_straddr. A local variable ai was uninitialized in the case of getaddrinfo failing. It is not set to 0 (NULL) as it should. This bug was introduced in YAZ 3.0.51 when a leak for getaddrinfo resources was fixed. --- diff --git a/src/tcpip.c b/src/tcpip.c index 50c0622..cb2883c 100644 --- a/src/tcpip.c +++ b/src/tcpip.c @@ -423,7 +423,7 @@ void *tcpip_straddr(COMSTACK h, const char *str) { tcpip_state *sp = (tcpip_state *)h->cprivate; const char *port = "210"; - struct addrinfo *ai; + struct addrinfo *ai = 0; if (h->protocol == PROTO_HTTP) port = "80"; if (!tcpip_init())