Fix memory leak in Linux libsecret wrapper.

secret_service_search_sync returns a glist, whose elements must also be freed.
The existing code did not do this. This CL creates a new SearchHelper to wrap
this call. The results are stored in the SearchHelper, whose destructor will
correctly free the elements.

This CL updates the key_storage_libsecret and native_backend_libsecret unittests
to return real GObjects from secret_service_search. The tear down steps now
check that the GObjects are correctly unreffed by the caller.

Bug: 801702, 393395
Change-Id: I0dcac794d4d79499742aea6e7e42a99135367a51
Commit-Queue: Erik Chen <>
Reviewed-by: Thomas Anderson <>
Reviewed-by: Vasilii Sukhanov <>
Reviewed-by: Christos Froussios <>
Cr-Commit-Position: refs/heads/master@{#530162}
6 files changed