]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
BusDesktopFile: Don't leak content if key=value appears before [Section]
authorSimon McVittie <smcv@collabora.com>
Fri, 16 Nov 2018 17:25:18 +0000 (17:25 +0000)
committerSimon McVittie <smcv@collabora.com>
Mon, 19 Nov 2018 11:38:11 +0000 (11:38 +0000)
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>
bus/desktop-file.c

index 64e9b143fa9590a097eda7c586de856e95d7a424..bf1e09cf52b262e3e384c22a5ee5c2d340b4f1fc 100644 (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