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();
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to