diff options
author | 2009-12-23 14:27:12 -0500 | |
---|---|---|
committer | 2009-12-23 14:27:12 -0500 | |
commit | ae8d0bfba9c05cf407f7591b34d8d10c157a0454 (patch) | |
tree | 60a375d03e5ee57ad539b1708207f516fd085561 | |
parent | 1466bbaa78fe224dd227fb50b2a6a21bcd10a74b (diff) |
Don't relify in bigLibs; fix some memory bugs in transactionals
-rw-r--r-- | src/c/urweb.c | 5 | ||||
-rw-r--r-- | src/compiler.sml | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index ef159333..472f6eb4 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -2851,7 +2851,8 @@ int uw_rollback(uw_context ctx) { ctx->transactionals[i].rollback(ctx->transactionals[i].data); for (i = 0; i < ctx->used_transactionals; ++i) - ctx->transactionals[i].free(ctx->transactionals[i].data); + if (ctx->transactionals[i].free) + ctx->transactionals[i].free(ctx->transactionals[i].data); return uw_db_rollback(ctx); } @@ -2859,7 +2860,7 @@ int uw_rollback(uw_context ctx) { void uw_register_transactional(uw_context ctx, void *data, uw_callback commit, uw_callback rollback, uw_callback free) { if (ctx->used_transactionals >= ctx->n_transactionals) { - ctx->transactionals = realloc(ctx->transactionals, ctx->used_transactionals+1); + ctx->transactionals = realloc(ctx->transactionals, sizeof(transactional) * (ctx->used_transactionals+1)); ++ctx->n_transactionals; } diff --git a/src/compiler.sml b/src/compiler.sml index 88046256..fc764205 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -561,7 +561,7 @@ fun parseUrp' accLibs fname = | "library" => if accLibs then libs := pu (relify arg) :: !libs else - bigLibs := relify arg :: !bigLibs + bigLibs := arg :: !bigLibs | "path" => (case String.fields (fn ch => ch = #"=") arg of [n, v] => pathmap := M.insert (!pathmap, n, v) |