[Differential] [Request, 395 lines] D1879: Don't allocate memory for operations that do not insert
rstone (Ryan Stone)
phabric-noreply at FreeBSD.org
Tue Feb 17 17:45:07 UTC 2015
rstone created this revision.
rstone added a reviewer: jfvogel.
rstone added subscribers: pjd, freebsd-net.
REVISION SUMMARY
Almost every operation performed on an nvlist was allocating a
new string to hold the key name. The nvlist_exists* family of
functions would always return false if they failed to allocate
the string. The rest of the functions would outright abort().
Fix the non-varargs variants of the functions to perform the
requested operations directly and the varargs versions to
allocate the string and call into the non-varargs versions.
The varargs versions are still broken and really can't be fixed,
so we might consider axing them entirely. However, now the non-
varargs functions are always safe to call.
REVISION DETAIL
https://reviews.freebsd.org/D1879
AFFECTED FILES
lib/libnv/dnvlist.c
lib/libnv/nv_impl.h
lib/libnv/nvlist.c
To: rstone, jfvogel
Cc: freebsd-net, pjd
More information about the freebsd-net
mailing list