BusDesktopFile: Don't leak content if key=value appears before [Section]

BusDesktopFile has a strange convention in which the various parser
helper functions (parse_section_start(), etc.) free the parser on error.
However, this particular error case happens outside the helper functions
and so will leak.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2018-11-16 17:25:18 +00:00
parent 24d0be54cc
commit 2df063be18

View file

@ -689,6 +689,7 @@ bus_desktop_file_load (DBusString *filename,
{
dbus_set_error(error, DBUS_ERROR_FAILED,
"invalid service file: key=value before [Section]");
parser_free (&parser);
return NULL;
}
else