Prevent double-free in zathura_document_free

This commit is contained in:
Moritz Lipp 2014-09-09 17:28:10 +02:00
parent 2ddb04d4ab
commit 735b31e2a5

View file

@ -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;
} }