Skip to content

Commit

Permalink
address more Coverity warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Dec 15, 2024
1 parent 811ff97 commit 6b9e982
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/cache/redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ static int oidc_cache_redis_destroy_impl(server_rec *s) {
oidc_cache_mutex_lock(s->process->pool, s, context->mutex);
context->disconnect(context);
oidc_cache_mutex_unlock(s->process->pool, s, context->mutex);
oidc_cache_mutex_destroy(s, context->mutex);
if (oidc_cache_mutex_destroy(s, context->mutex) != TRUE) {
oidc_serror(s, "oidc_cache_mutex_destroy on refresh mutex failed");
}
cfg->cache.cfg = NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static int oidc_state_cookies_delete_oldest(request_rec *r, oidc_cfg_t *c, int n
if (prev_oldest)
prev_oldest->next = oldest->next;
else
first = first ? first->next : NULL;
first = first->next;
}
number_of_valid_state_cookies--;
}
Expand Down
6 changes: 3 additions & 3 deletions test/test-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ static request_rec *request_setup(apr_pool_t *pool) {

oidc_dir_cfg_t *d_cfg = oidc_cfg_dir_config_create(request->pool, NULL);

request->server->module_config = apr_pcalloc(request->pool, sizeof(ap_conf_vector_t *) * kEls);
request->per_dir_config = apr_pcalloc(request->pool, sizeof(ap_conf_vector_t *) * kEls);
request->server->module_config = apr_pcalloc(request->pool, sizeof(void) * kEls);
request->per_dir_config = apr_pcalloc(request->pool, sizeof(void) * kEls);
ap_set_module_config(request->server->module_config, &auth_openidc_module, cfg);
ap_set_module_config(request->per_dir_config, &auth_openidc_module, d_cfg);

Expand Down Expand Up @@ -430,7 +430,7 @@ int uuid(int argc, char **argv, apr_pool_t *pool) {

if (argc > 2) {
n = _oidc_str_to_int(argv[2], n);
if ((n < 0) || (n > 25000000 * 10))
if (n > 25000000 * 10)
n = 25000000;
}

Expand Down
4 changes: 2 additions & 2 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1865,8 +1865,8 @@ static request_rec *test_setup(apr_pool_t *pool) {

oidc_dir_cfg_t *d_cfg = oidc_cfg_dir_config_create(request->pool, NULL);

request->server->module_config = apr_pcalloc(request->pool, sizeof(void *) * kEls);
request->per_dir_config = apr_pcalloc(request->pool, sizeof(void *) * kEls);
request->server->module_config = apr_pcalloc(request->pool, sizeof(void) * kEls);
request->per_dir_config = apr_pcalloc(request->pool, sizeof(void) * kEls);
ap_set_module_config(request->server->module_config, &auth_openidc_module, cfg);
ap_set_module_config(request->per_dir_config, &auth_openidc_module, d_cfg);

Expand Down

0 comments on commit 6b9e982

Please sign in to comment.