summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Deweerdt <fdeweerdt@fastly.com>2017-05-15 09:14:12 -0700
committerFrederik Deweerdt <fdeweerdt@fastly.com>2017-05-15 09:14:12 -0700
commite21c9c6729b8cd440fb97cf30b5db6144260de12 (patch)
tree0f0b0a32f884ace19d77163bb8fe34a3a91092c6
parent97cd8157f74674c722dd30360caac1f498fa72ef (diff)
Fix leak if setsockopt fails
-rw-r--r--net.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net.c b/net.c
index 024f645..d332db1 100644
--- a/net.c
+++ b/net.c
@@ -357,6 +357,7 @@ addrretry:
n = 1;
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char*) &n,
sizeof(n)) < 0) {
+ freeaddrinfo(bservinfo);
goto error;
}
}