core/service: fix memleak of USBFunctionStrings and USBFunctionDescriptors

oss-fuzz #6892.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-03-15 11:42:00 +01:00
parent 4b8d0cdf04
commit 064c593899
3 changed files with 7 additions and 0 deletions

View file

@ -396,6 +396,9 @@ static void service_done(Unit *u) {
s->bus_name_owner = mfree(s->bus_name_owner);
s->usb_function_descriptors = mfree(s->usb_function_descriptors);
s->usb_function_strings = mfree(s->usb_function_strings);
service_close_socket_fd(s);
s->peer = socket_peer_unref(s->peer);

View file

@ -0,0 +1,3 @@
service
[Service]
USBFunctionStrings=/

View file

@ -33,4 +33,5 @@ fuzz_regression_tests = '''
fuzz-unit-file/oss-fuzz-6885
fuzz-unit-file/oss-fuzz-6886
fuzz-unit-file/oss-fuzz-6917
fuzz-unit-file/oss-fuzz-6892
'''.split()