Skip to content

Commit d154355

Browse files
committed
make sure sqlite connection is freed on error (#42)
1 parent 31db17a commit d154355

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/cache_sqlite.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,10 @@ static void _mapcache_cache_mbtiles_set(mapcache_context *ctx, mapcache_tile *ti
706706
GC_CHECK_ERROR(ctx);
707707
if(!tile->raw_image) {
708708
tile->raw_image = mapcache_imageio_decode(ctx, tile->encoded_data);
709-
GC_CHECK_ERROR(ctx);
709+
if(GC_HAS_ERROR(ctx)) {
710+
_sqlite_release_conn(ctx, tile, conn);
711+
return;
712+
}
710713
}
711714
sqlite3_exec(conn->handle, "BEGIN TRANSACTION", 0, 0, 0);
712715
_single_mbtile_set(ctx,tile,conn);

0 commit comments

Comments
 (0)