Skip to content

Commit

Permalink
make sure sqlite connection is freed on error (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Aug 20, 2012
1 parent 31db17a commit d154355
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cache_sqlite.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,10 @@ static void _mapcache_cache_mbtiles_set(mapcache_context *ctx, mapcache_tile *ti
GC_CHECK_ERROR(ctx);
if(!tile->raw_image) {
tile->raw_image = mapcache_imageio_decode(ctx, tile->encoded_data);
GC_CHECK_ERROR(ctx);
if(GC_HAS_ERROR(ctx)) {
_sqlite_release_conn(ctx, tile, conn);
return;
}
}
sqlite3_exec(conn->handle, "BEGIN TRANSACTION", 0, 0, 0);
_single_mbtile_set(ctx,tile,conn);
Expand Down

0 comments on commit d154355

Please sign in to comment.