diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2015-06-19 10:52:10 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-06-19 14:02:53 +0200 |
commit | f2bba721d18842a014ab170c207af8e8ecb6e890 (patch) | |
tree | 6d3f34381a1d9fba8a5a5510f32f00ed9fab6499 | |
parent | 2b7ef850846029641cc59560c2d8d4ab7254dda5 (diff) | |
download | sssd-f2bba721d18842a014ab170c207af8e8ecb6e890.tar.gz sssd-f2bba721d18842a014ab170c207af8e8ecb6e890.tar.xz sssd-f2bba721d18842a014ab170c207af8e8ecb6e890.zip |
IFP: Fix warnings with enabled optimisation
It seems that gcc 5.1 optimize enum in some ways and expects that
unctions ifp_cache_build_path and ifp_cache_build_base_dn
can return unitialized value due to missing default in switch.
src/responder/ifp/ifp_cache.c:118:13: warning: 'base_dn' may be used uninitialized in this function [-Wmaybe-uninitialized]
ldb_ret = ldb_search(sysdb_ctx_get_ldb(domain->sysdb), tmp_ctx, &result,
^
src/responder/ifp/ifp_cache.c: scope_hint: In function 'ifp_cache_get_cached_objects'
src/responder/ifp/ifp_cache.c:135:18: warning: 'path' may be used uninitialized in this function [-Wmaybe-uninitialized]
paths[i] = ifp_cache_build_path(paths, type, domain, result->msgs[i]);
^
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r-- | src/responder/ifp/ifp_cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/responder/ifp/ifp_cache.c b/src/responder/ifp/ifp_cache.c index 9bf7ed7e7..a109ac05d 100644 --- a/src/responder/ifp/ifp_cache.c +++ b/src/responder/ifp/ifp_cache.c @@ -34,7 +34,7 @@ ifp_cache_build_base_dn(TALLOC_CTX *mem_ctx, enum ifp_cache_type type, struct sss_domain_info *domain) { - struct ldb_dn *base_dn; + struct ldb_dn *base_dn = NULL; switch (type) { case IFP_CACHE_USER: @@ -54,7 +54,7 @@ ifp_cache_build_path(TALLOC_CTX *mem_ctx, struct sss_domain_info *domain, struct ldb_message *msg) { - char *path; + char *path = NULL; switch (type) { case IFP_CACHE_USER: |