Skip to content

Commit b93d8f4

Browse files
committed
Merge pull request #15 from barkmadley/master
Remove use after free error in ref_count_finalize_dbw
2 parents 3bc0588 + b51fe73 commit b93d8f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/sqlite3_stubs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,10 @@ static inline void ref_count_finalize_dbw(db_wrap *dbw)
341341
{
342342
if (--dbw->ref_count == 0) {
343343
user_function *link;
344-
for (link = dbw->user_functions; link != NULL; link = link->next) {
344+
user_function *next;
345+
for (link = dbw->user_functions; link != NULL; link = next) {
345346
caml_remove_generational_global_root(&link->v_fun);
347+
next = link->next;
346348
caml_stat_free(link);
347349
}
348350
dbw->user_functions = NULL;

0 commit comments

Comments
 (0)