]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: Fix a crash trying to close a non existant inet listener
authorRoy Marples <roy@marples.name>
Fri, 29 Nov 2019 00:05:48 +0000 (00:05 +0000)
committerRoy Marples <roy@marples.name>
Fri, 29 Nov 2019 00:05:48 +0000 (00:05 +0000)
src/dhcp.c

index 1c079eebc8aceab18c84d3270794ca8e449f6581..f3f8592c83afc8116586b03debde612dfd2128f3 100644 (file)
@@ -1528,7 +1528,8 @@ dhcp_close(struct interface *ifp)
 #ifdef PRIVSEP
        if (ifp->ctx->options & DHCPCD_PRIVSEP) {
                ps_bpf_closebootp(ifp);
-               ps_inet_closebootp(state->addr);
+               if (state->addr != NULL)
+                       ps_inet_closebootp(state->addr);
        }
 #endif