From 985cd44c2b46b1acf13257d9a8e583ff957da010 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 1 May 2019 08:05:00 -0400 Subject: [PATCH] fix possible segfault after failed port alloc w/ iptables option fixes #767 Change-Id: I8034849655f1c6e4e59cf341b0ff99066223fcbc --- daemon/iptables.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/iptables.c b/daemon/iptables.c index 340098ca5..d38a37ffb 100644 --- a/daemon/iptables.c +++ b/daemon/iptables.c @@ -286,6 +286,9 @@ static int __iptables_add_rule(const socket_t *local_sock, const str *comment) { static int __iptables_del_rule(const socket_t *local_sock) { const char *err; + if (!local_sock || !local_sock->family) + return 0; + switch (local_sock->family->af) { case AF_INET: err = ip4tables_del_rule(local_sock);