summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2010-03-27 16:20:29 +0000
committerjsing <jsing@openbsd.org>2010-03-27 16:20:29 +0000
commitbf7d9428a1a8aa2ceb032e932249b5323f5b14d2 (patch)
tree6155a593c1f03de7dfe8ab3b8117e65e1c82a4dd /sys/dev/softraid.c
parentFix TX power per rate settings. (diff)
downloadwireguard-openbsd-bf7d9428a1a8aa2ceb032e932249b5323f5b14d2.tar.xz
wireguard-openbsd-bf7d9428a1a8aa2ceb032e932249b5323f5b14d2.zip
Correctly initialise variable to prevent free without malloc in error path.
Found by clang static analyser.
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r--sys/dev/softraid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 202c1584601..ecfc135cc7c 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.197 2010/03/26 16:50:59 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.198 2010/03/27 16:20:29 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -2297,7 +2297,7 @@ sr_hotspare(struct sr_softc *sc, dev_t dev)
struct sr_metadata *sm = NULL;
struct sr_meta_chunk *hm;
struct sr_chunk_head *cl;
- struct sr_chunk *hotspare, *chunk, *last;
+ struct sr_chunk *chunk, *last, *hotspare = NULL;
struct sr_uuid uuid;
struct disklabel label;
struct vnode *vn;