libadmin: Fix isAlias may be uninitialized warning 72/14772/6
authorMichael Meffie <mmeffie@sinenomine.net>
Mon, 23 Aug 2021 19:42:52 +0000 (15:42 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 4 Sep 2021 18:33:51 +0000 (14:33 -0400)
commit4a8d0c4089078fb3df9cc06b595c80c9b4c2ca7f
tree52ef636f16f445f52407919e6381dde725ad97ca
parent9d42150b7bf55cd1813d974cc4bba9233e38dcde
libadmin: Fix isAlias may be uninitialized warning

The cfgutil_HostNameIsAlias() function has an output parameter called
isAlias, which is used when cfgutil_HostIsAlias() returns non-zero.
However, it possible for isAlias to not be set before returning. GCC 12
issues a warning about the possible use of the uninitialized isAlias
variable:

    cfginternal.c:366:32: error: ‘isAlias’ may be used uninitialized
       [-Werror=maybe-uninitialized]

Initialize the cfgutil_HostNameIsAlias() isAlias output flag to false.
Also, fix the misleading code indentation around the
cfgutil_HostNameIsAlias() call.

Change-Id: I68e66ae5f9019a613187321bb792d0505959ed30
Reviewed-on: https://gerrit.openafs.org/14772
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/libadmin/cfg/cfginternal.c