ircd: various memory leak fixes from pull requests

This commit is contained in:
William Pitcock 2016-02-09 10:48:28 -06:00
parent 87c44482d0
commit 55d5f7970a
6 changed files with 10 additions and 7 deletions

View file

@ -451,7 +451,7 @@ void irc_dictionary_destroy(struct Dictionary *dtree,
}
rb_dlinkDelete(&dtree->node, &dictionary_list);
rb_free(dtree->id);
rb_free(dtree);
}

View file

@ -218,6 +218,8 @@ irc_radixtree_destroy(struct irc_radixtree *dtree, void (*destroy_cb)(const char
irc_radixtree_delete(dtree, delem->leaf.key);
}
rb_dlinkDelete(&dtree->node, &radixtree_list);
rb_free(dtree->id);
rb_free(dtree);
}

View file

@ -707,6 +707,7 @@ unload_one_module(const char *name, int warn)
lt_dlclose(modlist[modindex]->address);
rb_free(modlist[modindex]->name);
rb_free(modlist[modindex]);
memmove(&modlist[modindex], &modlist[modindex + 1],
sizeof(struct module *) * ((num_mods - 1) - modindex));

View file

@ -864,8 +864,8 @@ conf_set_listen_port_both(void *data, int ssl)
{
if (!ssl)
{
conf_report_error("listener '%s/%d': support for plaintext listeners is being deprecated and may be removed in a future release. "
"It is suggested that users be migrated to SSL/TLS connections.", listener_address, args->v.number);
conf_report_error("listener 'ANY/%d': support for plaintext listeners is being deprecated and may be removed in a future release. "
"It is suggested that users be migrated to SSL/TLS connections.", args->v.number);
}
add_listener(args->v.number, listener_address, AF_INET, ssl, ssl || yy_defer_accept);
#ifdef RB_IPV6
@ -884,8 +884,8 @@ conf_set_listen_port_both(void *data, int ssl)
if (!ssl)
{
conf_report_error("listener 'ANY/%d': support for plaintext listeners is being deprecated and may be removed in a future release. "
"It is suggested that users be migrated to SSL/TLS connections.", args->v.number);
conf_report_error("listener '%s/%d': support for plaintext listeners is being deprecated and may be removed in a future release. "
"It is suggested that users be migrated to SSL/TLS connections.", listener_address, args->v.number);
}
add_listener(args->v.number, listener_address, family, ssl, ssl || yy_defer_accept);

View file

@ -83,7 +83,7 @@ void substitution_free(rb_dlink_list *varlist)
{
struct substitution_variable *tmp = (struct substitution_variable *) nptr->data;
rb_dlinkDelete(nptr, varlist);
rb_dlinkDestroy(nptr, varlist);
rb_free(tmp->name);
rb_free(tmp->value);
rb_free(tmp);

View file

@ -449,7 +449,7 @@ rb_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
s = va_arg(args, char *);
if(s == NULL)
{
abort(); /* prefer blowing up vs corrupt data */
s = "(null)";
}
len = rb_strnlen(s, precision);