}
-static int __set_real_event_info(
- const char *real_event, const char *event)
+static int __set_real_event_info(const char *real_event, const char *event)
{
- char *key = NULL, *value = NULL;
- int ret = ES_R_OK;
+ char *key;
+ char *value;
if (g_hash_table_lookup(__event_table, real_event) != NULL)
return ES_R_OK;
key = strdup(real_event);
- if (key == NULL) {
- ret = ES_R_ENOMEM;
- goto out;
- }
+ if (key == NULL)
+ return ES_R_ENOMEM;
value = strdup(event);
if (value == NULL) {
- ret = ES_R_ENOMEM;
- goto out;
+ free(key);
+ return ES_R_ENOMEM;
}
-out:
- if (ret == ES_R_OK) {
- g_hash_table_insert(__event_table, key, value);
- } else {
- if (key)
- free(key);
- if (value)
- free(value);
- }
- return ret;
+ g_hash_table_insert(__event_table, key, value);
+
+ return ES_R_OK;
}
/* LCOV_EXCL_START */