mirror of
https://github.com/bstansell/conserver.git
synced 2025-01-27 06:09:19 +00:00
fix SEGFAULT on early exit with IPv6 enabled
Some command line options, like e.g -V, will cause conserver to exit before the IPv6 address variables are initialized. Avoid the calls to freeaddrinfo() in these cases. Signed-off-by: Bjørn Mork <bjorn@mork.no>
This commit is contained in:
parent
b7aa0508f0
commit
ec846dfedd
@ -53,8 +53,8 @@ int fAll = 0, fNoinit = 0, fVersion = 0, fStrip = 0, fReopen =
|
|||||||
char *pcConfig = CONFIGFILE;
|
char *pcConfig = CONFIGFILE;
|
||||||
int cMaxMemb = MAXMEMB;
|
int cMaxMemb = MAXMEMB;
|
||||||
#if USE_IPV6
|
#if USE_IPV6
|
||||||
struct addrinfo *bindAddr;
|
struct addrinfo *bindAddr = (struct addrinfo *)0;
|
||||||
struct addrinfo *bindBaseAddr;
|
struct addrinfo *bindBaseAddr = (struct addrinfo *)0;
|
||||||
#else
|
#else
|
||||||
in_addr_t bindAddr = INADDR_ANY;
|
in_addr_t bindAddr = INADDR_ANY;
|
||||||
unsigned short bindPort;
|
unsigned short bindPort;
|
||||||
@ -781,8 +781,10 @@ DestroyDataStructures(void)
|
|||||||
|
|
||||||
#if USE_IPV6
|
#if USE_IPV6
|
||||||
/* clean up addrinfo stucts */
|
/* clean up addrinfo stucts */
|
||||||
freeaddrinfo(bindAddr);
|
if ((struct addrinfo *)0 != bindAddr)
|
||||||
freeaddrinfo(bindBaseAddr);
|
freeaddrinfo(bindAddr);
|
||||||
|
if ((struct addrinfo *)0 != bindBaseAddr)
|
||||||
|
freeaddrinfo(bindBaseAddr);
|
||||||
#else
|
#else
|
||||||
if (myAddrs != (struct in_addr *)0)
|
if (myAddrs != (struct in_addr *)0)
|
||||||
free(myAddrs);
|
free(myAddrs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user