Commit 735b31e2 authored by Moritz Lipp's avatar Moritz Lipp

Prevent double-free in zathura_document_free

parent 2ddb04d4
...@@ -173,13 +173,16 @@ error_free: ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment