talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 9c845be70dcef765a44790657578660c4affb94d
parent 7698ec3ca69965809c20f9e3416519128fb668d3
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Mon, 19 Nov 2018 11:23:35 +0100

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.

Diffstat:
Msrc/common/xml.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 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);