Skip to content
Permalink
Browse files

allocate empty rules array instead of NULL

  • Loading branch information
tomhel committed May 9, 2016
1 parent 3766754 commit 9ae54331bf01e12c1292b8ce2f980a5b9aaf2697
Showing with 2 additions and 4 deletions.
  1. +1 −1 include/mapcache.h
  2. +1 −3 lib/configuration_xml.c
@@ -1049,7 +1049,7 @@ struct mapcache_grid_link {
int minz,maxz;

/**
* rules (mapcache_rule) for each zoom level or NULL
* rules (mapcache_rule) for each zoom level
* index in array = zoom level
*/
apr_array_header_t *rules;
@@ -741,7 +741,7 @@ void parseTileset(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
gridlink->grid_limits = (mapcache_extent_i*)apr_pcalloc(ctx->pool,grid->nlevels*sizeof(mapcache_extent_i));
gridlink->outofzoom_strategy = MAPCACHE_OUTOFZOOM_NOTCONFIGURED;
gridlink->intermediate_grids = apr_array_make(ctx->pool,1,sizeof(mapcache_grid_link*));
gridlink->rules = NULL;
gridlink->rules = apr_array_make(ctx->pool,0,sizeof(mapcache_rule*));

ruleset_name = (char*)ezxml_attr(cur_node,"ruleset");
if(ruleset_name) {
@@ -797,8 +797,6 @@ void parseTileset(mapcache_context *ctx, ezxml_t node, mapcache_cfg *config)
mapcache_grid_compute_limits(grid,extent,gridlink->grid_limits,tolerance);

if(ruleset) {
gridlink->rules = apr_array_make(ctx->pool,grid->nlevels,sizeof(mapcache_rule*));

for(i = 0; i < grid->nlevels; i++) {
mapcache_rule *rule = mapcache_ruleset_rule_find(ruleset->rules, i);

0 comments on commit 9ae5433

Please sign in to comment.
You can’t perform that action at this time.