Merge branch 'desktop-file-leak' into 'master'

bus: Fix memory leaks when parsing .service files

See merge request dbus/dbus!42

Reviewed-by: pwithnall
This commit is contained in:
Simon McVittie 2018-11-20 11:21:32 +00:00
commit 269e0548e2
2 changed files with 3 additions and 0 deletions

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

View file

@ -214,6 +214,7 @@ test_content (const Test *test,
g_assert_nonnull (error.message);
g_assert_false (ok);
g_assert_null (val);
dbus_error_free (&error);
}
else
{
@ -263,6 +264,7 @@ test_invalid (Fixture *f,
g_assert_nonnull (error.name);
g_assert_nonnull (error.message);
g_assert_null (bdf);
dbus_error_free (&error);
/* Check that it's OK to ignore the error */
bdf = bus_desktop_file_load (&str, NULL);