From ee12d78cea5ed5f277f869151a918c8b606887e4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 3 Dec 2009 13:36:29 +0100 Subject: [PATCH] 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. --- src/tcpip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) -- 1.7.10.4