Module Name:    src
Committed By:   martin
Date:           Wed Jul 24 11:12:31 UTC 2019

Modified Files:
        src/sys/external/bsd/libnv/dist: nvpair.c

Log Message:
PR kern/54406: the result of vasprintf (in the kernel) should be freed
by kmem_free(). Spotted by Mindaugas.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/libnv/dist/nvpair.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/libnv/dist/nvpair.c
diff -u src/sys/external/bsd/libnv/dist/nvpair.c:1.7 src/sys/external/bsd/libnv/dist/nvpair.c:1.8
--- src/sys/external/bsd/libnv/dist/nvpair.c:1.7	Tue Jul 23 00:49:16 2019
+++ src/sys/external/bsd/libnv/dist/nvpair.c	Wed Jul 24 11:12:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvpair.c,v 1.7 2019/07/23 00:49:16 rmind Exp $	*/
+/*	$NetBSD: nvpair.c,v 1.8 2019/07/24 11:12:30 martin Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -36,7 +36,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: head/sys/contrib/libnv/nvpair.c 335382 2018-06-19 18:43:02Z lwhsu $");
 #else
-__RCSID("$NetBSD: nvpair.c,v 1.7 2019/07/23 00:49:16 rmind Exp $");
+__RCSID("$NetBSD: nvpair.c,v 1.8 2019/07/24 11:12:30 martin Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1216,7 +1216,7 @@ nvpair_create_stringv(const char *name, 
 	if (len < 0)
 		return (NULL);
 	nvp = nvpair_create_string(name, str);
-	nv_free(str);
+	kmem_free(str, len);
 	return (nvp);
 }
 #endif

Reply via email to