<p>Some storages already have free(store) in close function. For example store_ro_composite.c:</p>
<pre><code>static int ro_composite_close_storage(struct storage_backend * store) {
struct ro_composite_ctx * ctx = (struct ro_composite_ctx *)(store->storage_ctx);
ctx->store_primary->close_storage(ctx->store_primary);
ctx->store_secondary->close_storage(ctx->store_secondary);
if(ctx->cache.tile) free(ctx->cache.tile);
free(ctx);
free(store);
return 0;
}
</code></pre>
<p>Here is the patch for renderd_list.c</p>
<pre><code>--- a/src/render_list.c
+++ b/src/render_list.c
@@ -301,7 +301,9 @@ int main(int argc, char **argv)
}
store->close_storage(store);
- free(store);
+ if (store != NULL) {
+ free(store);
+ }
finish_workers();
free(spath);
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/openstreetmap/mod_tile/issues/66'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/4046574__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNjA4OTA0MCwiZGF0YSI6eyJpZCI6MjQxNzk2NTJ9fQ==--562435f312ce08d58b0fd18b8504af91de5aacf8.gif' height='1' width='1'></p>