summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_msdos
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2015-12-10 17:26:59 +0000
committermmcc <mmcc@openbsd.org>2015-12-10 17:26:59 +0000
commit5ce950dec1b2e812fc64a836d68b866ed975b0f1 (patch)
treed453d92e4bcff417f3cd4107c8726aa912a9501f /sbin/fsck_msdos
parentcomment typo (diff)
downloadwireguard-openbsd-5ce950dec1b2e812fc64a836d68b866ed975b0f1.tar.xz
wireguard-openbsd-5ce950dec1b2e812fc64a836d68b866ed975b0f1.zip
Remove NULL-checks before free(). ok tb@
Diffstat (limited to 'sbin/fsck_msdos')
-rw-r--r--sbin/fsck_msdos/dir.c5
-rw-r--r--sbin/fsck_msdos/fat.c8
2 files changed, 5 insertions, 8 deletions
diff --git a/sbin/fsck_msdos/dir.c b/sbin/fsck_msdos/dir.c
index 75cd23bf16d..5ab153d5e3c 100644
--- a/sbin/fsck_msdos/dir.c
+++ b/sbin/fsck_msdos/dir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dir.c,v 1.29 2015/08/20 22:02:21 deraadt Exp $ */
+/* $OpenBSD: dir.c,v 1.30 2015/12/10 17:26:59 mmcc Exp $ */
/* $NetBSD: dir.c,v 1.11 1997/10/17 11:19:35 ws Exp $ */
/*
@@ -975,7 +975,6 @@ reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head)
void
finishlf(void)
{
- if (lfbuf)
- free(lfbuf);
+ free(lfbuf);
lfbuf = NULL;
}
diff --git a/sbin/fsck_msdos/fat.c b/sbin/fsck_msdos/fat.c
index 38e32a94c6e..85d6f2a3419 100644
--- a/sbin/fsck_msdos/fat.c
+++ b/sbin/fsck_msdos/fat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fat.c,v 1.26 2015/09/27 16:56:06 guenther Exp $ */
+/* $OpenBSD: fat.c,v 1.27 2015/12/10 17:26:59 mmcc Exp $ */
/* $NetBSD: fat.c,v 1.8 1997/10/17 11:19:53 ws Exp $ */
/*
@@ -86,10 +86,8 @@ readfat(int fs, struct bootblock *boot, int no, struct fatEntry **fp)
buffer = calloc(boot->FATsecs, boot->BytesPerSec);
if (fat == NULL || buffer == NULL) {
xperror("No space for FAT");
- if (fat != NULL)
- free(fat);
- if (buffer != NULL)
- free(buffer);
+ free(fat);
+ free(buffer);
return (FSFATAL);
}