From ac12d0c8aa293032076a3e419c29bbc1c36554ec Mon Sep 17 00:00:00 2001 From: djcb Date: Mon, 17 Sep 2012 13:05:49 +0300 Subject: [PATCH] * lib/mu-runtime: fix broken error handling --- lib/mu-runtime.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/mu-runtime.c b/lib/mu-runtime.c index 6a392c4f..09038133 100644 --- a/lib/mu-runtime.c +++ b/lib/mu-runtime.c @@ -26,6 +26,7 @@ #include #include #include + #include "mu-msg.h" #include "mu-log.h" #include "mu-util.h" @@ -95,7 +96,8 @@ mu_runtime_init (const char* muhome_arg, const char *name) } _data = g_new0 (MuRuntimeData, 1); - _data->_str[MU_RUNTIME_PATH_MUHOME] = muhome; + _data->_str[MU_RUNTIME_PATH_MUHOME] = muhome; + init_paths (muhome, _data); _data->_name = g_strdup (name); @@ -113,15 +115,16 @@ runtime_free (void) { int i; - for (i = 0; i != MU_RUNTIME_PATH_NUM; ++i) - g_free (_data->_str[i]); - - g_free (_data->_name); - - /* mu_config_uninit (_data->_config); */ - mu_log_uninit(); + if (!_data) + return; + + if (_data->_str) + for (i = 0; i != MU_RUNTIME_PATH_NUM; ++i) + g_free (_data->_str[i]); + + g_free (_data->_name); g_free (_data); }