From c0101cced8fb506a486d6adae307f795bcad599f Mon Sep 17 00:00:00 2001 From: eric Date: Sat, 6 Apr 2019 10:35:48 +0000 Subject: [PATCH] do not call freeaddrinfo() on a NULL pointer. --- usr.sbin/lpd/resolver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/lpd/resolver.c b/usr.sbin/lpd/resolver.c index 5b73e29b618..059a1032a38 100644 --- a/usr.sbin/lpd/resolver.c +++ b/usr.sbin/lpd/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.3 2019/04/04 19:25:46 eric Exp $ */ +/* $OpenBSD: resolver.c,v 1.4 2019/04/06 10:35:48 eric Exp $ */ /* * Copyright (c) 2017-2018 Eric Faurot @@ -326,7 +326,8 @@ resolver_getaddrinfo_cb(struct asr_result *ar, void *arg) m_add_int(s->proc, ar->ar_errno); m_close(s->proc); - freeaddrinfo(ar->ar_addrinfo); + if (ar->ar_addrinfo) + freeaddrinfo(ar->ar_addrinfo); free(s); } -- 2.20.1