Browse Source

small memleak fix

personal/stbuehler/wip
Thomas Porzelt 14 years ago
parent
commit
480de71283
  1. 2
      src/config_parser.rl
  2. 3
      src/plugin.c
  3. 2
      src/plugin_core.c

2
src/config_parser.rl

@ -498,7 +498,6 @@
}
g_hash_table_insert(ctx->uservars, str, val);
val = NULL; /* prevent free */
}
else {
/* normal assignment */
@ -512,7 +511,6 @@
}
value_free(name);
value_free(val);
}
action function_noparam {

3
src/plugin.c

@ -74,7 +74,7 @@ void server_plugins_free(server *srv) {
g_hash_table_iter_init(&i, srv->plugins);
while (g_hash_table_iter_next(&i, &key, &val)) {
plugin *p = (plugin*) val;
plugin_free_options(srv, p);
plugin_free_actions(srv, p);
plugin_free_setups(srv, p);
@ -206,6 +206,7 @@ gboolean parse_option(server *srv, const char *name, value *val, option_set *mar
if (!sopt->parse_option) {
mark->value = value_extract(val);
value_free(val);
} else {
if (!sopt->parse_option(srv, sopt->p, sopt->module_index, val, &mark->value)) {
/* errors should be logged by parse function */

2
src/plugin_core.c

@ -479,6 +479,8 @@ static gboolean core_option_log_timestamp_parse(server *srv, plugin *p, size_t n
if (!val) return TRUE;
oval->ptr = log_timestamp_new(srv, value_extract(val).string);
value_free(val);
return TRUE;
}

Loading…
Cancel
Save