diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2000-07-17 19:51:42 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2000-07-17 19:51:42 +0000 |
| commit | a12de06299afd0a4d87da41d2f2df72f02c1bb20 (patch) | |
| tree | 564bf920f0c3028643c3713ffa2afff4ea1cbfbd | |
| parent | f15da231c58ddddb9492713e62a7f5719a9c58d1 (diff) | |
Notes
| -rw-r--r-- | sbin/fdisk/fdisk.c | 4 | ||||
| -rw-r--r-- | sbin/i386/fdisk/fdisk.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index acbd6ae22701..723db8d1d414 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -299,11 +299,11 @@ main(int argc, char *argv[]) } /* (abu)use mboot.bootinst to probe for the sector size */ - if (mboot.bootinst != NULL) - free(mboot.bootinst); if ((mboot.bootinst = malloc(MAX_SEC_SIZE)) == NULL) err(1, "cannot allocate buffer to determine disk sector size"); read_disk(0, mboot.bootinst); + free(mboot.bootinst); + mboot.bootinst = NULL; if (s_flag) { diff --git a/sbin/i386/fdisk/fdisk.c b/sbin/i386/fdisk/fdisk.c index acbd6ae22701..723db8d1d414 100644 --- a/sbin/i386/fdisk/fdisk.c +++ b/sbin/i386/fdisk/fdisk.c @@ -299,11 +299,11 @@ main(int argc, char *argv[]) } /* (abu)use mboot.bootinst to probe for the sector size */ - if (mboot.bootinst != NULL) - free(mboot.bootinst); if ((mboot.bootinst = malloc(MAX_SEC_SIZE)) == NULL) err(1, "cannot allocate buffer to determine disk sector size"); read_disk(0, mboot.bootinst); + free(mboot.bootinst); + mboot.bootinst = NULL; if (s_flag) { |
