# HG changeset patch # User Adam Chlipala # Date 1264969730 18000 # Node ID bafb6a5a52a9e6b49c2c58563fa07d0a535449c1 # Parent a9ba22d551f0c1b2a9a0c7a700d5dcaf08519e1f A litter more cautious about NULL applications; plug a memory leak in some Postgres functions diff -r a9ba22d551f0 -r bafb6a5a52a9 src/c/urweb.c --- a/src/c/urweb.c Sun Jan 31 07:44:49 2010 -0500 +++ b/src/c/urweb.c Sun Jan 31 15:28:50 2010 -0500 @@ -2884,7 +2884,7 @@ if (ctx->transactionals[i].free) ctx->transactionals[i].free(ctx->transactionals[i].data); - return ctx->app->db_rollback(ctx); + return ctx->app ? ctx->app->db_rollback(ctx) : 0; } void uw_commit(uw_context ctx) { diff -r a9ba22d551f0 -r bafb6a5a52a9 src/postgres.sml --- a/src/postgres.sml Sun Jan 31 07:44:49 2010 -0500 +++ b/src/postgres.sml Sun Jan 31 15:28:50 2010 -0500 @@ -411,6 +411,8 @@ newline], string "}", newline, + string "PQclear(res);", + newline, string "return 0;", newline, string "}", @@ -434,6 +436,8 @@ newline], string "}", newline, + string "PQclear(res);", + newline, string "return 0;", newline, string "}", @@ -457,6 +461,8 @@ newline], string "}", newline, + string "PQclear(res);", + newline, string "return 0;", newline, string "}",