diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2009-05-07 12:36:02 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2009-05-07 12:36:02 +0000 |
| commit | b48323a2a029ff636afa44c31e3a397d1db326f3 (patch) | |
| tree | 1c609dbdd3a912ebc47713ceb3a633eb115295cd | |
| parent | 81bc017436149a18efe93fed2adb324639c753c7 (diff) | |
Fix bug in lasso_registry_destroy / shutdown
* lasso/registry.c:
if not initialized, do not free. do not segfault on NULL argument.
| -rw-r--r-- | lasso/registry.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lasso/registry.c b/lasso/registry.c index e06dc287..b093f506 100644 --- a/lasso/registry.c +++ b/lasso/registry.c @@ -75,7 +75,8 @@ static LassoRegistry *lasso_registry_get_default() { void lasso_registry_default_shutdown() { - lasso_registry_destroy(default_registry); + if (default_registry) + lasso_registry_destroy(default_registry); default_registry = NULL; } @@ -173,6 +174,8 @@ LassoRegistry *lasso_registry_new() */ void lasso_registry_destroy(LassoRegistry *registry) { + g_return_if_fail(registry); + g_hash_table_destroy(registry->direct_mapping); registry->direct_mapping = NULL; g_hash_table_destroy(registry->functional_mapping); |
