summaryrefslogtreecommitdiff
path: root/sbin/disklabel
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2014-02-15 02:39:39 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2014-02-15 02:39:39 +0000
commit6d95691b2cbf90d4458cac824b8e856fa76d6967 (patch)
treed2f2acdbc013ed6fdc2faf9e5e807f8ddf340d98 /sbin/disklabel
parent3ef850803b69da0cf14a1320a07c61f5eb711838 (diff)
Don't risk dereferencing NULL pointer to mountpoints array
when calling mpfree() with the array.
Diffstat (limited to 'sbin/disklabel')
-rw-r--r--sbin/disklabel/editor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 7a58848deff..3a5eb677611 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.279 2014/02/15 00:10:17 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.280 2014/02/15 02:39:38 krw Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -1902,6 +1902,9 @@ mpfree(char **mp)
{
int part;
+ if (mp == NULL)
+ return;
+
for (part == 0; part < MAXPARTITIONS; part++) {
free(mp[part]);
mp[part] = NULL;