From: eric Date: Sat, 6 Apr 2019 10:35:48 +0000 (+0000) Subject: do not call freeaddrinfo() on a NULL pointer. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c0101cced8fb506a486d6adae307f795bcad599f;p=openbsd do not call freeaddrinfo() on a NULL pointer. --- 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); }