Skip to content

Conversation

joeshaw
Copy link
Contributor

@joeshaw joeshaw commented Oct 27, 2016

The sqlite3_backup_finish() function never fails, it just returns the
error code from previous operations. Previously if it returned an
error, the finalizer wouldn't be unset and sqlite3_backup_finish() would
be run again on an already-finished backup. This results in a
double-free and often segfaults.

The error handling is described in more detail in the "Error handling"
section of https://www.sqlite.org/backup.html.

The sqlite3_backup_finish() function never fails, it just returns the
error code from previous operations.  Previously if it returned an
error, the finalizer wouldn't be unset and sqlite3_backup_finish() would
be run again on an already-finished backup.  This results in a
double-free and often segfaults.

The error handling is described in more detail in the "Error handling"
section of https://www.sqlite.org/backup.html.
@coveralls
Copy link

coveralls commented Oct 27, 2016

Coverage Status

Coverage increased (+0.3%) to 62.564% when pulling bdab31c on joeshaw:backup-finalizer-fix into e5a3c16 on mattn:master.

@mattn mattn merged commit 955dae4 into mattn:master Oct 27, 2016
@mattn
Copy link
Owner

mattn commented Oct 27, 2016

Thank you

@joeshaw joeshaw deleted the backup-finalizer-fix branch October 27, 2016 23:58
@joeshaw joeshaw restored the backup-finalizer-fix branch October 28, 2016 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants