summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-03-25 09:44:47 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-03-25 09:44:47 (GMT)
commit16d050be2b5660f86cf65c465dd5e49ed615b4d0 (patch)
treea5b5fe00a264970ce37c88d0531f3b9ce6865020
parent8e275f286138db88140d1643d1008f130ba7f484 (diff)
Released lock in all cases.
-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);