svn commit: r324834 - stable/11/sys/contrib/libnv

Mariusz Zaborski oshogbo at FreeBSD.org
Sat Oct 21 19:38:37 UTC 2017


Author: oshogbo
Date: Sat Oct 21 19:38:36 2017
New Revision: 324834
URL: https://svnweb.freebsd.org/changeset/base/324834

Log:
  MFC r323860:
  Plug memory leak in case when nvlist allocation succeeds, but nvpair
  allocation fails.
  
  Submitted by: pjd@
  Sponsored by: Wheel Systems

Modified:
  stable/11/sys/contrib/libnv/nvpair.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/contrib/libnv/nvpair.c
==============================================================================
--- stable/11/sys/contrib/libnv/nvpair.c	Sat Oct 21 19:37:25 2017	(r324833)
+++ stable/11/sys/contrib/libnv/nvpair.c	Sat Oct 21 19:38:36 2017	(r324834)
@@ -1087,7 +1087,7 @@ nvpair_unpack_nvlist_array(bool isbe __unused, nvpair_
 	return (ptr);
 fail:
 	ERRNO_SAVE();
-	for (j = 0; j < ii; j++)
+	for (j = 0; j <= ii; j++)
 		nvlist_destroy(value[j]);
 	nv_free(value);
 	ERRNO_RESTORE();


More information about the svn-src-stable mailing list