Date: Tue, 17 Feb 2015 17:45:06 +0000 From: "rstone (Ryan Stone)" <phabric-noreply@FreeBSD.org> To: freebsd-net@freebsd.org Subject: [Differential] [Request, 395 lines] D1879: Don't allocate memory for operations that do not insert Message-ID: <differential-rev-PHID-DREV-axuyayxpwb4ftwsvp47h-req@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?differential-rev-PHID-DREV-axuyayxpwb4ftwsvp47h-req>