From: Marcel Holtmann Date: Sat, 18 Oct 2008 16:06:18 +0000 (+0200) Subject: Fix memory leak when plugin init fails X-Git-Tag: 2.0_alpha~4627 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e3e56199f01eda60b6f2d54d4133137ef546314b;p=framework%2Fconnectivity%2Fconnman.git Fix memory leak when plugin init fails --- diff --git a/src/plugin.c b/src/plugin.c index cfbd906..153b7be 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -47,8 +47,10 @@ static gboolean add_plugin(void *handle, struct connman_plugin_desc *desc) plugin->handle = handle; plugin->desc = desc; - if (desc->init() < 0) + if (desc->init() < 0) { + g_free(plugin); return FALSE; + } plugins = g_slist_append(plugins, plugin);