From c78c36cd9c6af40b97241a455bd3022708b30095 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Thu, 17 Aug 2017 20:41:28 +0000 Subject: [PATCH] Don't leak bpf on early return when YP isn't defined (NIS support) MFC after: 1 week Reported by: cppcheck --- usr.sbin/bootparamd/bootparamd/bootparamd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/bootparamd/bootparamd/bootparamd.c b/usr.sbin/bootparamd/bootparamd/bootparamd.c index 08cda8c4b01d..9c45cf8d0f38 100644 --- a/usr.sbin/bootparamd/bootparamd/bootparamd.c +++ b/usr.sbin/bootparamd/bootparamd/bootparamd.c @@ -239,6 +239,8 @@ int blen; warnx("could not close %s", bootpfile); return(1); #else + if (fclose(bpf)) + warnx("could not close %s", bootpfile); return(0); /* ENOTSUP */ #endif }