mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 13:46:01 +01:00
Prevent double-free in zathura_document_free
This commit is contained in:
parent
2ddb04d4ab
commit
735b31e2a5
1 changed files with 3 additions and 0 deletions
|
@ -173,13 +173,16 @@ error_free:
|
||||||
if (file != NULL) {
|
if (file != NULL) {
|
||||||
g_object_unref(file);
|
g_object_unref(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(real_path);
|
g_free(real_path);
|
||||||
|
|
||||||
if (document != NULL) {
|
if (document != NULL) {
|
||||||
zathura_document_free(document);
|
zathura_document_free(document);
|
||||||
|
document = NULL; /* prevent double-free */
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(document);
|
g_free(document);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue