summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glibext/configuration.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/glibext/configuration.c b/src/glibext/configuration.c
index 09d2d37..8f2103d 100644
--- a/src/glibext/configuration.c
+++ b/src/glibext/configuration.c
@@ -1517,12 +1517,14 @@ GCfgParam *_g_generic_config_add_param(GGenConfig *config, GCfgParam *param, boo
old = _g_generic_config_search(config, path, false);
if (old != NULL)
{
- g_object_unref(G_OBJECT(param));
- return NULL;
+ g_clear_object(&param);
+ goto exit;
}
config->params = g_list_append(config->params, param);
+ exit:
+
if (lock)
g_generic_config_wunlock(config);