summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-09-10 05:48:19 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-09-10 05:48:19 +0000
commit022e98743c90ef8ff9a8c7a30baedc9dcba3edf4 (patch)
tree7b7ea9e0ae176a7a6800dcdaf5db30820284a7cd
parent5f3ff35be3e327d610a6a39de18342d40b78837d (diff)
missing fclose() in an error path
-rw-r--r--usr.sbin/kvm_mkdb/nlist.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/kvm_mkdb/nlist.c b/usr.sbin/kvm_mkdb/nlist.c
index 629af583389..18f895a97b0 100644
--- a/usr.sbin/kvm_mkdb/nlist.c
+++ b/usr.sbin/kvm_mkdb/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.49 2015/12/10 18:40:46 mmcc Exp $ */
+/* $OpenBSD: nlist.c,v 1.50 2016/09/10 05:48:18 jsg Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -84,8 +84,10 @@ __elf_knlist(int fd, DB *db, int ksyms)
if (fseek(fp, (off_t)0, SEEK_SET) == -1 ||
fread(&eh, sizeof(eh), 1, fp) != 1 ||
- !IS_ELF(eh))
+ !IS_ELF(eh)) {
+ fclose(fp);
return (1);
+ }
sh = calloc(sizeof(Elf_Shdr), eh.e_shnum);
if (sh == NULL)