mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 22:56:00 +01:00
Don't free content_type before setting error message
This commit is contained in:
parent
ee1f0da3dc
commit
cfc0c2aa7d
1 changed files with 7 additions and 2 deletions
|
@ -94,15 +94,20 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char*
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin = zathura_plugin_manager_get_plugin(plugin_manager, content_type);
|
plugin = zathura_plugin_manager_get_plugin(plugin_manager, content_type);
|
||||||
g_free((void*)content_type);
|
|
||||||
content_type = NULL;
|
|
||||||
|
|
||||||
if (plugin == NULL) {
|
if (plugin == NULL) {
|
||||||
girara_error("Unknown file type: '%s'", content_type);
|
girara_error("Unknown file type: '%s'", content_type);
|
||||||
check_set_error(error, ZATHURA_ERROR_UNKNOWN);
|
check_set_error(error, ZATHURA_ERROR_UNKNOWN);
|
||||||
|
|
||||||
|
g_free((void*)content_type);
|
||||||
|
content_type = NULL;
|
||||||
|
|
||||||
goto error_free;
|
goto error_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free((void*)content_type);
|
||||||
|
content_type = NULL;
|
||||||
|
|
||||||
document = g_try_malloc0(sizeof(zathura_document_t));
|
document = g_try_malloc0(sizeof(zathura_document_t));
|
||||||
if (document == NULL) {
|
if (document == NULL) {
|
||||||
check_set_error(error, ZATHURA_ERROR_OUT_OF_MEMORY);
|
check_set_error(error, ZATHURA_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
Loading…
Reference in a new issue