On Thu, Mar 12, 2015 at 11:16:41AM +0100, Jakub Hrozek wrote:
I'm also waiting for a Coverity check to finish.
There are some warnings, mostly the same problem copied around:
Error: COMPILER_WARNING:
sssd-1.12.90/src/responder/common/responder_cache_req.c:232:8: warning: 'ret' may
be used uninitialized in this function [-Wmaybe-uninitialized]
# if (ret == EEXIST) {
# ^
sssd-1.12.90/src/responder/common/responder_cache_req.c:212:13: note: 'ret' was
declared here
# errno_t ret;
# ^
Error: COMPILER_WARNING:
sssd-1.12.90/src/responder/common/responder_cache_req.c: scope_hint: In function
'cache_req_get_object'
sssd-1.12.90/src/responder/common/responder_cache_req.c:343:8: warning: 'ret' may
be used uninitialized in this function [-Wmaybe-uninitialized]
# if (ret != EOK) {
# ^
Error: COMPILER_WARNING:
sssd-1.12.90/src/responder/common/responder_cache_req.c:348:30: warning:
'one_item_only' may be used uninitialized in this function
[-Wmaybe-uninitialized]
# } else if (one_item_only && result->count > 1) {
# ^
Error: COMPILER_WARNING:
sssd-1.12.90/src/responder/common/responder_cache_req.c:26: included_from: Included from
here.
sssd-1.12.90/src/responder/common/responder_cache_req.c: scope_hint: In function
'cache_req_cache_done'
sssd-1.12.90/src/util/util.h:130:9: warning: 'ret' may be used uninitialized in
this function [-Wmaybe-uninitialized]
# debug_fn(__FILE__, __LINE__, __FUNCTION__, \
# ^
sssd-1.12.90/src/responder/common/responder_cache_req.c:243:13: note: 'ret' was
declared here
# errno_t ret;
# ^
I think it's fine to initialize ret to ERR_INTERNAL in that case. We know
that one of the 'case' statements would hit, so this change could be just
another precaution.