rx: Make rx_opaque_free idempotent
Currently rx_opaque_free sets the given argument to NULL, a style that
helps prevent double-frees. However, it doesn't check if the given
buffer is already NULL, which makes potential callers that use a 'goto
done'-style cleanup block do something like:
done:
if (buf)
rx_opaque_free(&buf);
To avoid the extra if(), make rx_opaque_free a no-op if it's given a
NULL buffer, similar to how free(NULL) is a no-op on most platforms.
Slightly refactor how we reference our argument as well, to limit the
number of layers of indirection the code needs to deal with.
Do the same for rx_opaque_zeroFree.
Note that there are currently no callers of
rx_opaque_free/rx_opaque_zeroFree, but future commits will add some.
Change-Id: Ic86a9c63903bebbddd311912cfbcb61198e3f0b0
Reviewed-on: https://gerrit.openafs.org/13944
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>