Fix memory leak on ConnectionManagerTest.
ConnectionManagerTest::SetServiceReply had a memory leak only present
on unittest code. This patch uses g_new0() and g_free() to manage the
memory of GValue objects on GValueNewString and GValueFree, which
allows to use GValueFree to remove any GValue object.
It also replaces the GArray* by a GPtrArray which is what dbus-glib
uses and what is being passed as the GType, as defined on the
DBusWrapperInterface.
BUG=chromium:378548
TEST=`FEATURES="test" USE="clang asan" emerge-link update_engine` doesn't show ConnectionManager failures
TEST=tested on link the update_engine detects the current connection from shill.
Change-Id: I328ba79e2d609ab1cfe3df8b99b82fa24262de08
Reviewed-on: https://chromium-review.googlesource.com/202060
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
3 files changed