Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Mar 2005 11:13:16 +0100
From:      des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To:        Anish Mistry <mistry.7@osu.edu>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/kern kern_environment.c
Message-ID:  <86acpdunyb.fsf@xps.des.no>
In-Reply-To: <200503082051.20064.mistry.7@osu.edu>
References:  <200503051552.j25FqCjg079895@repoman.freebsd.org> <200503082051.20064.mistry.7@osu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--Boundary_(ID_1czkZxGYYcY8em5/EnCGug)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: quoted-printable

Anish Mistry <mistry.7@osu.edu> writes:
> On Saturday 05 March 2005 10:52 am, Dag-Erling Smorgrav wrote:
> >   Log:
> >   Teach getenv_quad() to recognize k/m/g/t suffixes in both lower-
> > and upper-case.  This means (almost) all tunables now support those
> > suffixes.
> This commit breaks resuming from suspend on my laptop.

Hrm.  Try the attached patch.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no


--Boundary_(ID_1czkZxGYYcY8em5/EnCGug)
Content-type: text/x-patch; NAME=kern_environment.diff
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=kern_environment.diff

Index: sys/kern/kern_environment.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_environment.c,v
retrieving revision 1.38
diff -u -r1.38 kern_environment.c
--- sys/kern/kern_environment.c	5 Mar 2005 15:52:12 -0000	1.38
+++ sys/kern/kern_environment.c	9 Mar 2005 10:11:40 -0000
@@ -458,9 +458,10 @@
 	if (value == NULL)
 		return (0);
 	iv = strtoq(value, &vtp, 0);
-	freeenv(value);
-	if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0'))
+	if (vtp == value || (vtp[0] != '\0' && vtp[1] != '\0')) {
+		freeenv(value);
 		return (0);
+	}
 	switch (vtp[0]) {
 	case 't': case 'T':
 		iv *= 1024;
@@ -473,9 +474,11 @@
 	case '\0':
 		break;
 	default:
+		freeenv(value);
 		return (0);
 	}
 	*data = iv;
+	freeenv(value);
 	return (1);
 }
 

--Boundary_(ID_1czkZxGYYcY8em5/EnCGug)--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86acpdunyb.fsf>