Resolve possible null pointer dereference

This commit is contained in:
Moritz Lipp 2012-02-07 20:05:24 +01:00
parent c42a72f996
commit 33e37b12e4

View file

@ -334,8 +334,10 @@ prepare_document_open_from_stdin(zathura_t* zathura)
gint handle = g_file_open_tmp("zathura.stdin.XXXXXX", &file, &error);
if (handle == -1)
{
girara_error("Can not create temporary file: %s", error->message);
g_error_free(error);
if (error != NULL) {
girara_error("Can not create temporary file: %s", error->message);
g_error_free(error);
}
return NULL;
}