device: fix leaking internal device factories

Actually, we anyway leak them, because they are added to static hash tables
which are never released. Anyway, get the ref-count right.

(cherry picked from commit 4c43d7cad3)
This commit is contained in:
Thomas Haller 2018-06-20 16:31:18 +02:00
parent 2b2e9bba74
commit aa27007ff0

View file

@ -330,7 +330,7 @@ _load_internal_factory (GType factory_gtype,
NMDeviceFactoryManagerFactoryFunc callback,
gpointer user_data)
{
NMDeviceFactory *factory;
gs_unref_object NMDeviceFactory *factory = NULL;
factory = (NMDeviceFactory *) g_object_new (factory_gtype, NULL);
_add_factory (factory, NULL, callback, user_data);