summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2017-01-30 14:36:56 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2017-02-01 14:11:09 +0100
commitbf0b4eb335ec1fb4fdd925f5cf80490ec8b8c24e (patch)
tree73c3afbfc0f40b8f647297f21e3be3b36b53a2c3 /src/tools
parentc587e9ae55c618c011bd4dde6a94fe5dc60fff01 (diff)
downloadsssd-bf0b4eb335ec1fb4fdd925f5cf80490ec8b8c24e.tar.gz
sssd-bf0b4eb335ec1fb4fdd925f5cf80490ec8b8c24e.tar.xz
sssd-bf0b4eb335ec1fb4fdd925f5cf80490ec8b8c24e.zip
sssctl: Fix warning may be used uninitialized
gcc 7 probably does some new optimisations which might cause few wariables to be uninitialized. src/tools/sssctl/sssctl_cache.c: In function ‘sssctl_print_object’: src/tools/sssctl/sssctl_cache.c:523:13: error: ‘dom’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ret = info[i].attr_fn(tmp_ctx, entry, dom, info[i].attr, &value); ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/tools/sssctl/sssctl_cache.c:472:15: error: ‘entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized] *_entry = talloc_steal(mem_ctx, entry); ^~~~~~~~~~~~ src/tools/sssctl/sssctl_cache.c:437:25: note: ‘entry’ was declared here struct sysdb_attrs *entry; ^~~~~ Another workaround would be to remove static modifier from function sssctl_find_object which probably prevents some inlinig + optimisation. Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/sssctl/sssctl_cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/sssctl/sssctl_cache.c b/src/tools/sssctl/sssctl_cache.c
index 59c8cb473..8f0fc281b 100644
--- a/src/tools/sssctl/sssctl_cache.c
+++ b/src/tools/sssctl/sssctl_cache.c
@@ -434,8 +434,8 @@ static errno_t sssctl_fetch_object(TALLOC_CTX *mem_ctx,
struct sss_domain_info **_dom)
{
TALLOC_CTX *tmp_ctx;
- struct sysdb_attrs *entry;
- struct sss_domain_info *dom;
+ struct sysdb_attrs *entry = NULL;
+ struct sss_domain_info *dom = NULL;
const char **attrs;
char *sanitized;
errno_t ret;