@@ -103,9 +103,8 @@ int oidc_cache_shm_post_config(server_rec *s) {
103
103
}
104
104
105
105
/* initialize the whole segment to '/0' */
106
- int i ;
107
106
oidc_cache_shm_entry_t * t = apr_shm_baseaddr_get (context -> shm );
108
- for (i = 0 ; i < cfg -> cache .shm_size_max ; i ++ , OIDC_CACHE_SHM_ADD_OFFSET (t , cfg -> cache .shm_entry_size_max )) {
107
+ for (int i = 0 ; i < cfg -> cache .shm_size_max ; i ++ , OIDC_CACHE_SHM_ADD_OFFSET (t , cfg -> cache .shm_entry_size_max )) {
109
108
t -> section_key [0 ] = '\0' ;
110
109
t -> access = 0 ;
111
110
}
@@ -220,11 +219,12 @@ static apr_byte_t oidc_cache_shm_set(request_rec *r, const char *section, const
220
219
oidc_cfg_t * cfg = ap_get_module_config (r -> server -> module_config , & auth_openidc_module );
221
220
oidc_cache_cfg_shm_t * context = (oidc_cache_cfg_shm_t * )cfg -> cache .cfg ;
222
221
223
- oidc_cache_shm_entry_t * match , * free , * lru ;
224
- oidc_cache_shm_entry_t * t ;
225
- apr_time_t current_time ;
226
- int i ;
227
- apr_time_t age ;
222
+ oidc_cache_shm_entry_t * match = NULL ;
223
+ oidc_cache_shm_entry_t * free = NULL ;
224
+ oidc_cache_shm_entry_t * lru = NULL ;
225
+ oidc_cache_shm_entry_t * t = NULL ;
226
+ apr_time_t current_time = 0 ;
227
+ apr_time_t age = 0 ;
228
228
229
229
const char * section_key = oidc_cache_shm_get_key (r , section , key );
230
230
if (section_key == NULL )
@@ -255,7 +255,7 @@ static apr_byte_t oidc_cache_shm_set(request_rec *r, const char *section, const
255
255
match = NULL ;
256
256
free = NULL ;
257
257
lru = t ;
258
- for (i = 0 ; i < cfg -> cache .shm_size_max ; i ++ , OIDC_CACHE_SHM_ADD_OFFSET (t , cfg -> cache .shm_entry_size_max )) {
258
+ for (int i = 0 ; i < cfg -> cache .shm_size_max ; i ++ , OIDC_CACHE_SHM_ADD_OFFSET (t , cfg -> cache .shm_entry_size_max )) {
259
259
260
260
/* see if this slot is free */
261
261
if (t -> section_key [0 ] == '\0' ) {
@@ -327,15 +327,15 @@ static int oidc_cache_shm_destroy(server_rec *s) {
327
327
oidc_slog (s , APLOG_TRACE1 , "destroy: %pp (shm=%pp,s=%pp, p=%d)" , context , context ? context -> shm : 0 , s ,
328
328
context ? context -> is_parent : -1 );
329
329
330
- if (( context ) && (context -> is_parent == TRUE) && (context -> shm ) && (context -> mutex )) {
330
+ if (context && (context -> is_parent == TRUE) && (context -> shm ) && (context -> mutex )) {
331
331
oidc_cache_mutex_lock (s -> process -> pool , s , context -> mutex );
332
332
rv = apr_shm_destroy (context -> shm );
333
333
oidc_sdebug (s , "apr_shm_destroy returned: %d" , rv );
334
334
context -> shm = NULL ;
335
335
oidc_cache_mutex_unlock (s -> process -> pool , s , context -> mutex );
336
336
}
337
337
338
- if (( context ) && (context -> mutex )) {
338
+ if (context && (context -> mutex )) {
339
339
if (oidc_cache_mutex_destroy (s , context -> mutex ) != TRUE)
340
340
rv = APR_EGENERAL ;
341
341
context -> mutex = NULL ;
0 commit comments