From d63612b470cf9ace01841a2902c20c9bd51c9871 Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Sat, 17 Sep 2005 14:56:10 +0000 Subject: [PATCH] Call gctl_free() to free resource allocated with gctl_get_handle(). PR: bin/84664 Submitted by: Daan Vreeken MFC after: 3 days --- sbin/fdisk/fdisk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index 1eaca86a7fee..d0b12b766db1 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -761,9 +761,12 @@ write_disk(off_t sector, void *buf) gctl_ro_param(grq, "geom", -1, q); gctl_ro_param(grq, "data", secsize, buf); q = gctl_issue(grq); - if (q == NULL) + if (q == NULL) { + gctl_free(grq); return(0); + } warnx("%s", q); + gctl_free(grq); error = pwrite(fd, buf, secsize, (sector * 512)); if (error == secsize)