summaryrefslogtreecommitdiffstats
path: root/sys/isofs
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2017-02-08 01:32:38 +0000
committerjsg <jsg@openbsd.org>2017-02-08 01:32:38 +0000
commit0327e84a38d05f19ce40af70ed98086f587c69d5 (patch)
treebc0183f3ea796ec8daae81190c4399ab8ad72ca0 /sys/isofs
parentTest for NULL before dereferencing a pointer not after. (diff)
downloadwireguard-openbsd-0327e84a38d05f19ce40af70ed98086f587c69d5.tar.xz
wireguard-openbsd-0327e84a38d05f19ce40af70ed98086f587c69d5.zip
Move a pointer deref to after a NULL test.
ok krw@
Diffstat (limited to 'sys/isofs')
-rw-r--r--sys/isofs/udf/udf_vfsops.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/isofs/udf/udf_vfsops.c b/sys/isofs/udf/udf_vfsops.c
index ef343803aee..6c66b2782ba 100644
--- a/sys/isofs/udf/udf_vfsops.c
+++ b/sys/isofs/udf/udf_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vfsops.c,v 1.57 2016/09/24 18:38:23 tedu Exp $ */
+/* $OpenBSD: udf_vfsops.c,v 1.58 2017/02/08 01:32:38 jsg Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -430,9 +430,8 @@ udf_mountfs(struct vnode *devvp, struct mount *mp, uint32_t lb, struct proc *p)
return (0);
bail:
- hashfree(ump->um_hashtbl, UDF_HASHTBLSIZE, M_UDFMOUNT);
-
if (ump != NULL) {
+ hashfree(ump->um_hashtbl, UDF_HASHTBLSIZE, M_UDFMOUNT);
free(ump, M_UDFMOUNT, 0);
mp->mnt_data = NULL;
mp->mnt_flag &= ~MNT_LOCAL;