summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-03-07 21:58:08 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-03-07 21:58:08 +0100
commit077b157218254437185b5cb9d0267df72a918b79 (patch)
tree95564b7f4acf4d743463f675e1fa8bdf17421f55 /src/lib
parentef47609ab73ba222e0ef9f2da51dca4650af69d8 (diff)
downloadabrt-077b157218254437185b5cb9d0267df72a918b79.tar.gz
abrt-077b157218254437185b5cb9d0267df72a918b79.tar.xz
abrt-077b157218254437185b5cb9d0267df72a918b79.zip
Fixes for g_event_config_list == NULL
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/event_config.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
index 77cbaf4b..3eebb197 100644
--- a/src/lib/event_config.c
+++ b/src/lib/event_config.c
@@ -5,6 +5,7 @@ GHashTable *g_event_config_list;
// (Re)loads data from /etc/abrt/events/*.{conf,xml}
void load_event_config_data(void)
{
+ free_event_config_data();
/* for each xml file call load_event_description_from_file */
/* for each conf file call load_even_options_value_from_file?
* - we don't have this
@@ -12,15 +13,20 @@ void load_event_config_data(void)
* - or should this one be called first?
*/
}
+
/* Frees all loaded data */
void free_event_config_data(void)
{
-
+ if (g_event_config_list)
+ {
+ g_hash_table_destroy(g_event_config_list);
+ g_event_config_list = NULL;
+ }
}
event_config_t *get_event_config(const char *name)
{
- //could g_event_config_list be null?
- gpointer event_config = g_hash_table_lookup(g_event_config_list, name);
- return event_config;
+ if (!g_event_config_list)
+ return NULL;
+ return g_hash_table_lookup(g_event_config_list, name);
}