diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-05-17 01:06:57 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-05-17 01:06:57 +0000 |
commit | 43b3502499f593d85fcabe98e9c4ac1038ed2614 (patch) | |
tree | a537cecf8407321d05a3b71dc3754c6aba9ca535 /sbin/disklabel | |
parent | e2cace4d6a88a30bc522c606087d15fdbe5af360 (diff) |
Initialize mountpoints[] when going past again:, since a
smaller alloc table will have fewer mountpoints and the
extras cause confusion. And any info from '/etc/fstab'
that was loaded into mountpoints needs to be zapped too.
Noticed by jim@
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/editor.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index c42544a636c..3093058a0c1 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.209 2009/05/13 17:02:46 deraadt Exp $ */ +/* $OpenBSD: editor.c,v 1.210 2009/05/17 01:06:56 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.209 2009/05/13 17:02:46 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.210 2009/05/17 01:06:56 krw Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -530,6 +530,10 @@ editor_allocspace(struct disklabel *lp_org) cylsecs = lp_org->d_secpercyl; again: lp = &label; + for (i=0; i<MAXPARTITIONS; i++) { + free(mountpoints[i]); + mountpoints[i] = NULL; + } memcpy(lp, lp_org, sizeof(struct disklabel)); lp->d_npartitions = MAXPARTITIONS; lastalloc = alloc_table[index].sz; |