]>
git.michaelhowe.org Git - packages/o/openafs.git/commit
cmd: Avoid premature OptionAsString free
Only free the previously-set string value if we're actually going to
change it. This avoids the scenario where a caller does something
like:
char *str = strdup("defaultval");
/* ... */
cmd_OptionAsString(as, OPT_foo, &str);
resulting in 'str' pointing to freed memory when the relevant option
is not specified, or there is some other error.
Change-Id: If1f94d5eb39cc4dba9a4195ff20850ff81737eb9
Reviewed-on: http://gerrit.openafs.org/7475
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>