From: Simon McVittie Date: Fri, 16 Nov 2018 17:25:18 +0000 (+0000) Subject: BusDesktopFile: Don't leak content if key=value appears before [Section] X-Git-Tag: dbus-1.13.8~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2df063be18f08111255d5089e1a91e09b8cc83f5;p=thirdparty%2Fdbus.git 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 --- diff --git a/bus/desktop-file.c b/bus/desktop-file.c index 64e9b143f..bf1e09cf5 100644 --- a/bus/desktop-file.c +++ b/bus/desktop-file.c @@ -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