Date: Thu, 21 Sep 2017 10:28:22 +0000 (UTC) From: Mariusz Zaborski <oshogbo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323860 - head/sys/contrib/libnv Message-ID: <201709211028.v8LASMme077071@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oshogbo Date: Thu Sep 21 10:28:22 2017 New Revision: 323860 URL: https://svnweb.freebsd.org/changeset/base/323860 Log: Plug memory leak in case when nvlist allocation succeeds, but nvpair allocation fails. Submitted by: pjd@ MFC after: 1 month Sponsored by: Wheel Systems Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:18:02 2017 (r323859) +++ head/sys/contrib/libnv/nvpair.c Thu Sep 21 10:28:22 2017 (r323860) @@ -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();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709211028.v8LASMme077071>