epan DTD parser: don't leak the full path string on error.

While we're at it, fix a return - the return value is a pointer, with
NULL meaning error, not a Boolean, with FALSE meaning error, so return
NULL, not FALSE.

Change-Id: Ie77fe2c6173293a2a202ad29a6c5033e2a401aa7
Ping-Bug: 16335
Reviewed-on: https://code.wireshark.org/review/37033
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
This commit is contained in:
Guy Harris 2020-05-02 14:53:48 -07:00 committed by Guy Harris
parent 4067652c86
commit 3618aa2cc6
1 changed files with 3 additions and 2 deletions

View File

@ -259,7 +259,7 @@ extern GString* dtd_preparse(const gchar* dname,const gchar* fname, GString* er
if (!in) {
if (err)
g_string_append_printf(err, "Could not open file: '%s', error: %s",fullname,g_strerror(errno));
g_free(fullname);
return NULL;
}
@ -268,7 +268,8 @@ extern GString* dtd_preparse(const gchar* dname,const gchar* fname, GString* er
g_string_append_printf(err, "Can't initialize scanner: %s",
strerror(errno));
fclose(in);
return FALSE;
g_free(fullname);
return NULL;
}
Dtd_PreParse_set_in(in, scanner);