From: Adam Dickmeiss Date: Thu, 3 Dec 2009 12:36:29 +0000 (+0100) Subject: Fix uninit-var bug in tcpip_straddr. X-Git-Tag: v3.0.52~1 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=6de1fc194bd1ee04e1468d251df3a582c25658ad;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())