freebsd-dev/sys/contrib/libnv
Mariusz Zaborski c696dd0687 Because nvp wasn't initialized on every loop iteration once we jumped
to 'fail' on error it was treated as success, because nvp!=NULL. Fix this
by not handling success under 'fail' label and by using separate variable
for parent nvpair.

If we succeeded to allocate nvlist, but failed to allocated nvpair we
would leak nvls[ii] on return. Destroy it when we cannot allocate nvpair,
before we goto fail.

Submitted by:	pjd@ and oshogbo@ (minor changes)
Found by:       scan-build
MFC after:	1 month
Sponsored by:	Wheel Systems
2017-09-21 10:10:42 +00:00
..
cnvlist.c Fix style issue in the cnv API. 2016-08-27 13:40:27 +00:00
dnvlist.c
nv_impl.h Add support for the arrays in nvlist library. 2015-08-15 06:34:49 +00:00
nvlist_impl.h Add cnv API. 2016-08-27 13:37:30 +00:00
nvlist.c Make the code consistent by always using 'fail' label. 2017-09-21 10:06:00 +00:00
nvpair_impl.h Add support for the arrays in nvlist library. 2015-08-15 06:34:49 +00:00
nvpair.c Because nvp wasn't initialized on every loop iteration once we jumped 2017-09-21 10:10:42 +00:00