From 9c845be70dcef765a44790657578660c4affb94d Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Mon, 19 Nov 2018 11:23:35 +0100 Subject: [PATCH] xml_parse_file() fails without assertion warning if xml_open_file() returns NULL. This is not a programmer mistake, therefore an assertion warning is not a good idea. xml_open_file() already shows an assertion warning if necessary. --- src/common/xml.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/xml.c b/src/common/xml.c index 874db1f94..5ed7597f3 100644 --- a/src/common/xml.c +++ b/src/common/xml.c @@ -88,6 +88,7 @@ XMLFile *xml_open_file(const gchar *path) newfile->fp = claws_fopen(path, "rb"); if (!newfile->fp) { + FILE_OP_ERROR(path, "fopen"); g_free(newfile); return NULL; } @@ -161,7 +162,8 @@ GNode *xml_parse_file(const gchar *path) GNode *node; file = xml_open_file(path); - cm_return_val_if_fail(file != NULL, NULL); + if (file == NULL) + return NULL; xml_get_dtd(file); -- 2.25.1