diff options
author | eric <eric@openbsd.org> | 2019-04-06 10:35:48 +0000 |
---|---|---|
committer | eric <eric@openbsd.org> | 2019-04-06 10:35:48 +0000 |
commit | c0101cced8fb506a486d6adae307f795bcad599f (patch) | |
tree | 7ee472042b5bec4964514e325632b999db521566 /usr.sbin/lpd | |
parent | Don't mangle command line arguments with strsep(). Mangle (diff) | |
download | wireguard-openbsd-c0101cced8fb506a486d6adae307f795bcad599f.tar.xz wireguard-openbsd-c0101cced8fb506a486d6adae307f795bcad599f.zip |
do not call freeaddrinfo() on a NULL pointer.
Diffstat (limited to 'usr.sbin/lpd')
-rw-r--r-- | usr.sbin/lpd/resolver.c | 5 |
1 files 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 <eric@openbsd.org> @@ -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); } |