Don't free content_type before setting error message

This commit is contained in:
Moritz Lipp 2015-01-20 21:37:04 +01:00
parent ee1f0da3dc
commit cfc0c2aa7d

View file

@ -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);
g_free((void*)content_type);
content_type = NULL;
if (plugin == NULL) {
girara_error("Unknown file type: '%s'", content_type);
check_set_error(error, ZATHURA_ERROR_UNKNOWN);
g_free((void*)content_type);
content_type = NULL;
goto error_free;
}
g_free((void*)content_type);
content_type = NULL;
document = g_try_malloc0(sizeof(zathura_document_t));
if (document == NULL) {
check_set_error(error, ZATHURA_ERROR_OUT_OF_MEMORY);