bin/84664: gctl_free() isn't called in fdisk.c

Daan Vreeken [PA4DAN] Danovitsch at
Mon Aug 8 11:20:20 GMT 2005

>Number:         84664
>Category:       bin
>Synopsis:       gctl_free() isn't called in fdisk.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 08 11:20:18 GMT 2005
>Originator:     Daan Vreeken [PA4DAN]
>Release:        FreeBSD 5.4-RELEASE i386
Vitsch Electronics
System: FreeBSD Racebeest.Vitsch.LAN 5.4-RELEASE FreeBSD 5.4-RELEASE #5: Sun Aug 7 19:58:10 CEST 2005 root at Racebeest.Vitsch.LAN:/usr/src/sys/i386/compile/Laptop i386

	In the current version of fdisk.c gctl_get_handle() and gctl_issue()
are called in order to update the MBR of a disk without a corresponding call
to gctl_free().


	Apply the following patch to src/sbin/fdisk/fdisk.c :

--- fdisk.c.patch begins here ---
--- src/sbin/fdisk/fdisk.c.1_80	Mon Aug  8 13:05:02 2005
+++ src/sbin/fdisk/fdisk.c	Mon Aug  8 13:06:09 2005
@@ -761,6 +761,7 @@
 	gctl_ro_param(grq, "geom", -1, q);
 	gctl_ro_param(grq, "data", secsize, buf);
 	q = gctl_issue(grq);
+	gctl_free(grq);
 	if (q == NULL)
 	warnx("%s", q);
--- fdisk.c.patch ends here ---


More information about the freebsd-bugs mailing list