mirror of
https://github.com/matrix-construct/construct
synced 2025-04-09 03:13:11 +02:00
MyMalloc -> rb_malloc
This commit is contained in:
parent
300a543344
commit
eddc2ab6d8
24 changed files with 54 additions and 54 deletions
|
@ -240,7 +240,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
sendto_one(source_p, form_str(RPL_ENDOFRSACHALLENGE2),
|
sendto_one(source_p, form_str(RPL_ENDOFRSACHALLENGE2),
|
||||||
me.name, source_p->name);
|
me.name, source_p->name);
|
||||||
rb_free(challenge);
|
rb_free(challenge);
|
||||||
DupString(source_p->localClient->opername, oper_p->name);
|
source_p->localClient->opername = rb_strdup(oper_p->name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sendto_one_notice(source_p, ":Failed to generate challenge.");
|
sendto_one_notice(source_p, ":Failed to generate challenge.");
|
||||||
|
@ -286,11 +286,11 @@ generate_challenge(char **r_challenge, char **r_response, RSA * rsa)
|
||||||
{
|
{
|
||||||
SHA1_Init(&ctx);
|
SHA1_Init(&ctx);
|
||||||
SHA1_Update(&ctx, (u_int8_t *)secret, CHALLENGE_SECRET_LENGTH);
|
SHA1_Update(&ctx, (u_int8_t *)secret, CHALLENGE_SECRET_LENGTH);
|
||||||
*r_response = MyMalloc(SHA_DIGEST_LENGTH);
|
*r_response = rb_malloc(SHA_DIGEST_LENGTH);
|
||||||
SHA1_Final((u_int8_t *)*r_response, &ctx);
|
SHA1_Final((u_int8_t *)*r_response, &ctx);
|
||||||
|
|
||||||
length = RSA_size(rsa);
|
length = RSA_size(rsa);
|
||||||
tmp = MyMalloc(length);
|
tmp = rb_malloc(length);
|
||||||
ret = RSA_public_encrypt(CHALLENGE_SECRET_LENGTH, secret, tmp, rsa, RSA_PKCS1_OAEP_PADDING);
|
ret = RSA_public_encrypt(CHALLENGE_SECRET_LENGTH, secret, tmp, rsa, RSA_PKCS1_OAEP_PADDING);
|
||||||
|
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
|
|
|
@ -660,7 +660,7 @@ majority_gline(struct Client *source_p, const char *user,
|
||||||
|
|
||||||
/* no pending gline, create a new one */
|
/* no pending gline, create a new one */
|
||||||
pending = (struct gline_pending *)
|
pending = (struct gline_pending *)
|
||||||
MyMalloc(sizeof(struct gline_pending));
|
rb_malloc(sizeof(struct gline_pending));
|
||||||
|
|
||||||
strlcpy(pending->oper_nick1, source_p->name,
|
strlcpy(pending->oper_nick1, source_p->name,
|
||||||
sizeof(pending->oper_nick1));
|
sizeof(pending->oper_nick1));
|
||||||
|
|
|
@ -249,7 +249,7 @@ static void safelist_client_instantiate(struct Client *client_p, struct ListClie
|
||||||
s_assert(MyClient(client_p));
|
s_assert(MyClient(client_p));
|
||||||
s_assert(params != NULL);
|
s_assert(params != NULL);
|
||||||
|
|
||||||
self = MyMalloc(sizeof(struct ListClient));
|
self = rb_malloc(sizeof(struct ListClient));
|
||||||
|
|
||||||
self->hash_indice = 0;
|
self->hash_indice = 0;
|
||||||
self->users_min = params->users_min;
|
self->users_min = params->users_min;
|
||||||
|
|
|
@ -116,7 +116,7 @@ static void blacklist_dns_callback(void *vptr, struct DNSReply *reply)
|
||||||
/* XXX: no IPv6 implementation, not to concerned right now though. */
|
/* XXX: no IPv6 implementation, not to concerned right now though. */
|
||||||
static void initiate_blacklist_dnsquery(struct Blacklist *blptr, struct Client *client_p)
|
static void initiate_blacklist_dnsquery(struct Blacklist *blptr, struct Client *client_p)
|
||||||
{
|
{
|
||||||
struct BlacklistClient *blcptr = MyMalloc(sizeof(struct BlacklistClient));
|
struct BlacklistClient *blcptr = rb_malloc(sizeof(struct BlacklistClient));
|
||||||
char buf[IRCD_BUFSIZE];
|
char buf[IRCD_BUFSIZE];
|
||||||
int ip[4];
|
int ip[4];
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ struct Blacklist *new_blacklist(char *name, char *reject_reason)
|
||||||
blptr = find_blacklist(name);
|
blptr = find_blacklist(name);
|
||||||
if (blptr == NULL)
|
if (blptr == NULL)
|
||||||
{
|
{
|
||||||
blptr = MyMalloc(sizeof(struct Blacklist));
|
blptr = rb_malloc(sizeof(struct Blacklist));
|
||||||
rb_dlinkAddAlloc(blptr, &blacklist_list);
|
rb_dlinkAddAlloc(blptr, &blacklist_list);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -49,7 +49,7 @@ make_class(void)
|
||||||
{
|
{
|
||||||
struct Class *tmp;
|
struct Class *tmp;
|
||||||
|
|
||||||
tmp = (struct Class *) MyMalloc(sizeof(struct Class));
|
tmp = (struct Class *) rb_malloc(sizeof(struct Class));
|
||||||
|
|
||||||
ConFreq(tmp) = DEFAULT_CONNECTFREQUENCY;
|
ConFreq(tmp) = DEFAULT_CONNECTFREQUENCY;
|
||||||
PingFreq(tmp) = DEFAULT_PINGFREQUENCY;
|
PingFreq(tmp) = DEFAULT_PINGFREQUENCY;
|
||||||
|
|
|
@ -1301,7 +1301,7 @@ dead_link(struct Client *client_p)
|
||||||
if(IsDead(client_p) || IsClosing(client_p) || IsMe(client_p))
|
if(IsDead(client_p) || IsClosing(client_p) || IsMe(client_p))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
abt = (struct abort_client *) MyMalloc(sizeof(struct abort_client));
|
abt = (struct abort_client *) rb_malloc(sizeof(struct abort_client));
|
||||||
|
|
||||||
if(client_p->flags & FLAGS_SENDQEX)
|
if(client_p->flags & FLAGS_SENDQEX)
|
||||||
strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
|
strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
|
||||||
|
@ -1888,7 +1888,7 @@ make_server(struct Client *client_p)
|
||||||
|
|
||||||
if(!serv)
|
if(!serv)
|
||||||
{
|
{
|
||||||
serv = (server_t *) MyMalloc(sizeof(server_t));
|
serv = (server_t *) rb_malloc(sizeof(server_t));
|
||||||
client_p->serv = serv;
|
client_p->serv = serv;
|
||||||
}
|
}
|
||||||
return client_p->serv;
|
return client_p->serv;
|
||||||
|
|
10
src/hash.c
10
src/hash.c
|
@ -89,11 +89,11 @@ rb_dlink_list *hostTable;
|
||||||
void
|
void
|
||||||
init_hash(void)
|
init_hash(void)
|
||||||
{
|
{
|
||||||
clientTable = MyMalloc(sizeof(rb_dlink_list) * U_MAX);
|
clientTable = rb_malloc(sizeof(rb_dlink_list) * U_MAX);
|
||||||
idTable = MyMalloc(sizeof(rb_dlink_list) * U_MAX);
|
idTable = rb_malloc(sizeof(rb_dlink_list) * U_MAX);
|
||||||
channelTable = MyMalloc(sizeof(rb_dlink_list) * CH_MAX);
|
channelTable = rb_malloc(sizeof(rb_dlink_list) * CH_MAX);
|
||||||
hostTable = MyMalloc(sizeof(rb_dlink_list) * HOST_MAX);
|
hostTable = rb_malloc(sizeof(rb_dlink_list) * HOST_MAX);
|
||||||
resvTable = MyMalloc(sizeof(rb_dlink_list) * R_MAX);
|
resvTable = rb_malloc(sizeof(rb_dlink_list) * R_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef RICER_HASHING
|
#ifndef RICER_HASHING
|
||||||
|
|
|
@ -66,7 +66,7 @@ int h_introduce_client;
|
||||||
void
|
void
|
||||||
init_hook(void)
|
init_hook(void)
|
||||||
{
|
{
|
||||||
hooks = MyMalloc(sizeof(hook) * HOOK_INCREMENT);
|
hooks = rb_malloc(sizeof(hook) * HOOK_INCREMENT);
|
||||||
|
|
||||||
#ifdef USE_IODEBUG_HOOKS
|
#ifdef USE_IODEBUG_HOOKS
|
||||||
h_iosend_id = register_hook("iosend");
|
h_iosend_id = register_hook("iosend");
|
||||||
|
@ -94,7 +94,7 @@ grow_hooktable(void)
|
||||||
{
|
{
|
||||||
hook *newhooks;
|
hook *newhooks;
|
||||||
|
|
||||||
newhooks = MyMalloc(sizeof(hook) * (max_hooks + HOOK_INCREMENT));
|
newhooks = rb_malloc(sizeof(hook) * (max_hooks + HOOK_INCREMENT));
|
||||||
memcpy(newhooks, hooks, sizeof(hook) * num_hooks);
|
memcpy(newhooks, hooks, sizeof(hook) * num_hooks);
|
||||||
|
|
||||||
rb_free(hooks);
|
rb_free(hooks);
|
||||||
|
|
|
@ -446,7 +446,7 @@ find_exact_conf_by_address(const char *address, int type, const char *username)
|
||||||
|
|
||||||
if(address == NULL)
|
if(address == NULL)
|
||||||
address = "/NOMATCH!/";
|
address = "/NOMATCH!/";
|
||||||
arec = MyMalloc(sizeof(struct AddressRec));
|
arec = rb_malloc(sizeof(struct AddressRec));
|
||||||
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
||||||
#ifdef IPV6
|
#ifdef IPV6
|
||||||
if(masktype == HM_IPV6)
|
if(masktype == HM_IPV6)
|
||||||
|
@ -503,7 +503,7 @@ add_conf_by_address(const char *address, int type, const char *username, struct
|
||||||
|
|
||||||
if(address == NULL)
|
if(address == NULL)
|
||||||
address = "/NOMATCH!/";
|
address = "/NOMATCH!/";
|
||||||
arec = MyMalloc(sizeof(struct AddressRec));
|
arec = rb_malloc(sizeof(struct AddressRec));
|
||||||
masktype = parse_netmask(address, (struct sockaddr *)&arec->Mask.ipa.addr, &bits);
|
masktype = parse_netmask(address, (struct sockaddr *)&arec->Mask.ipa.addr, &bits);
|
||||||
arec->Mask.ipa.bits = bits;
|
arec->Mask.ipa.bits = bits;
|
||||||
arec->masktype = masktype;
|
arec->masktype = masktype;
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct Dictionary
|
||||||
*/
|
*/
|
||||||
struct Dictionary *irc_dictionary_create(DCF compare_cb)
|
struct Dictionary *irc_dictionary_create(DCF compare_cb)
|
||||||
{
|
{
|
||||||
struct Dictionary *dtree = (struct Dictionary *) MyMalloc(sizeof(struct Dictionary));
|
struct Dictionary *dtree = (struct Dictionary *) rb_malloc(sizeof(struct Dictionary));
|
||||||
|
|
||||||
dtree->compare_cb = compare_cb;
|
dtree->compare_cb = compare_cb;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ struct Dictionary *irc_dictionary_create(DCF compare_cb)
|
||||||
struct Dictionary *irc_dictionary_create_named(const char *name,
|
struct Dictionary *irc_dictionary_create_named(const char *name,
|
||||||
DCF compare_cb)
|
DCF compare_cb)
|
||||||
{
|
{
|
||||||
struct Dictionary *dtree = (struct Dictionary *) MyMalloc(sizeof(struct Dictionary));
|
struct Dictionary *dtree = (struct Dictionary *) rb_malloc(sizeof(struct Dictionary));
|
||||||
|
|
||||||
dtree->compare_cb = compare_cb;
|
dtree->compare_cb = compare_cb;
|
||||||
DupString(dtree->id, name);
|
DupString(dtree->id, name);
|
||||||
|
|
|
@ -218,7 +218,7 @@ ircd_base64_encode(const unsigned char *str, int length)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = MyMalloc(((length + 2) / 3) * 5);
|
result = rb_malloc(((length + 2) / 3) * 5);
|
||||||
p = result;
|
p = result;
|
||||||
|
|
||||||
while (length > 2)
|
while (length > 2)
|
||||||
|
@ -255,7 +255,7 @@ ircd_base64_decode(const unsigned char *str, int length, int *ret)
|
||||||
int ch, i = 0, j = 0, k;
|
int ch, i = 0, j = 0, k;
|
||||||
unsigned char *result;
|
unsigned char *result;
|
||||||
|
|
||||||
result = MyMalloc(length + 1);
|
result = rb_malloc(length + 1);
|
||||||
|
|
||||||
while ((ch = *current++) != '\0' && length-- > 0) {
|
while ((ch = *current++) != '\0' && length-- > 0) {
|
||||||
if (ch == base64_pad) break;
|
if (ch == base64_pad) break;
|
||||||
|
|
|
@ -124,7 +124,7 @@ static void add_cur_list_cpt(conf_parm_t *new)
|
||||||
{
|
{
|
||||||
if (cur_list == NULL)
|
if (cur_list == NULL)
|
||||||
{
|
{
|
||||||
cur_list = MyMalloc(sizeof(conf_parm_t));
|
cur_list = rb_malloc(sizeof(conf_parm_t));
|
||||||
cur_list->type |= CF_FLIST;
|
cur_list->type |= CF_FLIST;
|
||||||
cur_list->v.list = new;
|
cur_list->v.list = new;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ static void add_cur_list(int type, char *str, int number)
|
||||||
{
|
{
|
||||||
conf_parm_t *new;
|
conf_parm_t *new;
|
||||||
|
|
||||||
new = MyMalloc(sizeof(conf_parm_t));
|
new = rb_malloc(sizeof(conf_parm_t));
|
||||||
new->next = NULL;
|
new->next = NULL;
|
||||||
new->type = type;
|
new->type = type;
|
||||||
|
|
||||||
|
@ -253,19 +253,19 @@ single: oneitem
|
||||||
|
|
||||||
oneitem: qstring
|
oneitem: qstring
|
||||||
{
|
{
|
||||||
$$ = MyMalloc(sizeof(conf_parm_t));
|
$$ = rb_malloc(sizeof(conf_parm_t));
|
||||||
$$->type = CF_QSTRING;
|
$$->type = CF_QSTRING;
|
||||||
DupString($$->v.string, $1);
|
DupString($$->v.string, $1);
|
||||||
}
|
}
|
||||||
| timespec
|
| timespec
|
||||||
{
|
{
|
||||||
$$ = MyMalloc(sizeof(conf_parm_t));
|
$$ = rb_malloc(sizeof(conf_parm_t));
|
||||||
$$->type = CF_TIME;
|
$$->type = CF_TIME;
|
||||||
$$->v.number = $1;
|
$$->v.number = $1;
|
||||||
}
|
}
|
||||||
| number
|
| number
|
||||||
{
|
{
|
||||||
$$ = MyMalloc(sizeof(conf_parm_t));
|
$$ = rb_malloc(sizeof(conf_parm_t));
|
||||||
$$->type = CF_INT;
|
$$->type = CF_INT;
|
||||||
$$->v.number = $1;
|
$$->v.number = $1;
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ oneitem: qstring
|
||||||
so pass it as that, if so */
|
so pass it as that, if so */
|
||||||
int val = conf_get_yesno_value($1);
|
int val = conf_get_yesno_value($1);
|
||||||
|
|
||||||
$$ = MyMalloc(sizeof(conf_parm_t));
|
$$ = rb_malloc(sizeof(conf_parm_t));
|
||||||
|
|
||||||
if (val != -1)
|
if (val != -1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@ conf_add_fields(struct ConfItem *aconf, const char *host_field,
|
||||||
{
|
{
|
||||||
if(!EmptyString(date_field))
|
if(!EmptyString(date_field))
|
||||||
{
|
{
|
||||||
aconf->passwd = MyMalloc(strlen(pass_field) + strlen(date_field) + 4);
|
aconf->passwd = rb_malloc(strlen(pass_field) + strlen(date_field) + 4);
|
||||||
rb_sprintf(aconf->passwd, "%s (%s)", pass_field, date_field);
|
rb_sprintf(aconf->passwd, "%s (%s)", pass_field, date_field);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -58,7 +58,7 @@ static listener_t *ListenerPollList = NULL;
|
||||||
static listener_t *
|
static listener_t *
|
||||||
make_listener(struct irc_sockaddr_storage *addr)
|
make_listener(struct irc_sockaddr_storage *addr)
|
||||||
{
|
{
|
||||||
listener_t *listener = (listener_t *) MyMalloc(sizeof(listener_t));
|
listener_t *listener = (listener_t *) rb_malloc(sizeof(listener_t));
|
||||||
s_assert(0 != listener);
|
s_assert(0 != listener);
|
||||||
|
|
||||||
listener->name = me.name;
|
listener->name = me.name;
|
||||||
|
|
|
@ -164,7 +164,7 @@ mod_add_path(const char *path)
|
||||||
if(mod_find_path(path))
|
if(mod_find_path(path))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pathst = MyMalloc(sizeof(struct module_path));
|
pathst = rb_malloc(sizeof(struct module_path));
|
||||||
|
|
||||||
strcpy(pathst->path, path);
|
strcpy(pathst->path, path);
|
||||||
rb_dlinkAddAlloc(pathst, &mod_paths);
|
rb_dlinkAddAlloc(pathst, &mod_paths);
|
||||||
|
@ -200,7 +200,7 @@ mod_clear_paths(void)
|
||||||
char *
|
char *
|
||||||
irc_basename(const char *path)
|
irc_basename(const char *path)
|
||||||
{
|
{
|
||||||
char *mod_basename = MyMalloc(strlen(path) + 1);
|
char *mod_basename = rb_malloc(strlen(path) + 1);
|
||||||
const char *s;
|
const char *s;
|
||||||
|
|
||||||
if(!(s = strrchr(path, '/')))
|
if(!(s = strrchr(path, '/')))
|
||||||
|
@ -248,7 +248,7 @@ load_all_modules(int warn)
|
||||||
|
|
||||||
modules_init();
|
modules_init();
|
||||||
|
|
||||||
modlist = (struct module **) MyMalloc(sizeof(struct module) * (MODS_INCREMENT));
|
modlist = (struct module **) rb_malloc(sizeof(struct module) * (MODS_INCREMENT));
|
||||||
|
|
||||||
max_mods = MODS_INCREMENT;
|
max_mods = MODS_INCREMENT;
|
||||||
|
|
||||||
|
@ -888,7 +888,7 @@ load_a_module(const char *path, int warn, int core)
|
||||||
|
|
||||||
increase_modlist();
|
increase_modlist();
|
||||||
|
|
||||||
modlist[num_mods] = MyMalloc(sizeof(struct module));
|
modlist[num_mods] = rb_malloc(sizeof(struct module));
|
||||||
modlist[num_mods]->address = tmpptr;
|
modlist[num_mods]->address = tmpptr;
|
||||||
modlist[num_mods]->version = ver;
|
modlist[num_mods]->version = ver;
|
||||||
modlist[num_mods]->core = core;
|
modlist[num_mods]->core = core;
|
||||||
|
@ -925,7 +925,7 @@ increase_modlist(void)
|
||||||
if((num_mods + 1) < max_mods)
|
if((num_mods + 1) < max_mods)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
new_modlist = (struct module **) MyMalloc(sizeof(struct module) *
|
new_modlist = (struct module **) rb_malloc(sizeof(struct module) *
|
||||||
(max_mods + MODS_INCREMENT));
|
(max_mods + MODS_INCREMENT));
|
||||||
memcpy((void *) new_modlist, (void *) modlist, sizeof(struct module) * num_mods);
|
memcpy((void *) new_modlist, (void *) modlist, sizeof(struct module) * num_mods);
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ add_top_conf(const char *name, int (*sfunc) (struct TopConf *),
|
||||||
{
|
{
|
||||||
struct TopConf *tc;
|
struct TopConf *tc;
|
||||||
|
|
||||||
tc = MyMalloc(sizeof(struct TopConf));
|
tc = rb_malloc(sizeof(struct TopConf));
|
||||||
|
|
||||||
tc->tc_name = name;
|
tc->tc_name = name;
|
||||||
tc->tc_sfunc = sfunc;
|
tc->tc_sfunc = sfunc;
|
||||||
|
@ -1582,7 +1582,7 @@ conf_set_service_name(void *data)
|
||||||
static int
|
static int
|
||||||
conf_begin_alias(struct TopConf *tc)
|
conf_begin_alias(struct TopConf *tc)
|
||||||
{
|
{
|
||||||
yy_alias = MyMalloc(sizeof(struct alias_entry));
|
yy_alias = rb_malloc(sizeof(struct alias_entry));
|
||||||
|
|
||||||
if (conf_cur_block_name != NULL)
|
if (conf_cur_block_name != NULL)
|
||||||
DupString(yy_alias->name, conf_cur_block_name);
|
DupString(yy_alias->name, conf_cur_block_name);
|
||||||
|
@ -1846,7 +1846,7 @@ add_conf_item(const char *topconf, const char *name, int type, void (*func) (voi
|
||||||
if((cf = find_conf_item(tc, name)) != NULL)
|
if((cf = find_conf_item(tc, name)) != NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
cf = MyMalloc(sizeof(struct ConfEntry));
|
cf = rb_malloc(sizeof(struct ConfEntry));
|
||||||
|
|
||||||
cf->cf_name = name;
|
cf->cf_name = name;
|
||||||
cf->cf_type = type;
|
cf->cf_type = type;
|
||||||
|
|
|
@ -282,7 +282,7 @@ read_ctrl_packet(int fd, void *data)
|
||||||
reply->datalen |= *len;
|
reply->datalen |= *len;
|
||||||
reply->gotdatalen++;
|
reply->gotdatalen++;
|
||||||
if(reply->datalen > 0)
|
if(reply->datalen > 0)
|
||||||
reply->data = MyMalloc(reply->datalen);
|
reply->data = rb_malloc(reply->datalen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(reply->gotdatalen < 2)
|
if(reply->gotdatalen < 2)
|
||||||
|
|
|
@ -148,7 +148,7 @@ add_reject(struct Client *client_p, const char *mask1, const char *mask2)
|
||||||
bitlen = 128;
|
bitlen = 128;
|
||||||
#endif
|
#endif
|
||||||
pnode = make_and_lookup_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip, bitlen);
|
pnode = make_and_lookup_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip, bitlen);
|
||||||
pnode->data = rdata = MyMalloc(sizeof(struct reject_data));
|
pnode->data = rdata = rb_malloc(sizeof(struct reject_data));
|
||||||
rb_dlinkAddTail(pnode, &rdata->rnode, &reject_list);
|
rb_dlinkAddTail(pnode, &rdata->rnode, &reject_list);
|
||||||
rdata->time = CurrentTime;
|
rdata->time = CurrentTime;
|
||||||
rdata->count = 1;
|
rdata->count = 1;
|
||||||
|
|
|
@ -296,7 +296,7 @@ static void rem_request(struct reslist *request)
|
||||||
*/
|
*/
|
||||||
static struct reslist *make_request(struct DNSQuery *query)
|
static struct reslist *make_request(struct DNSQuery *query)
|
||||||
{
|
{
|
||||||
struct reslist *request = MyMalloc(sizeof(struct reslist));
|
struct reslist *request = rb_malloc(sizeof(struct reslist));
|
||||||
|
|
||||||
request->sentat = CurrentTime;
|
request->sentat = CurrentTime;
|
||||||
request->retries = 3;
|
request->retries = 3;
|
||||||
|
@ -411,7 +411,7 @@ static void do_query_name(struct DNSQuery *query, const char *name, struct resli
|
||||||
if (request == NULL)
|
if (request == NULL)
|
||||||
{
|
{
|
||||||
request = make_request(query);
|
request = make_request(query);
|
||||||
request->name = (char *)MyMalloc(strlen(host_name) + 1);
|
request->name = (char *)rb_malloc(strlen(host_name) + 1);
|
||||||
strcpy(request->name, host_name);
|
strcpy(request->name, host_name);
|
||||||
request->state = REQ_A;
|
request->state = REQ_A;
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ static void do_query_number(struct DNSQuery *query, const struct irc_sockaddr_st
|
||||||
{
|
{
|
||||||
request = make_request(query);
|
request = make_request(query);
|
||||||
memcpy(&request->addr, addr, sizeof(struct irc_sockaddr_storage));
|
memcpy(&request->addr, addr, sizeof(struct irc_sockaddr_storage));
|
||||||
request->name = (char *)MyMalloc(HOSTLEN + 1);
|
request->name = (char *)rb_malloc(HOSTLEN + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addr->ss_family == AF_INET)
|
if (addr->ss_family == AF_INET)
|
||||||
|
@ -848,7 +848,7 @@ static struct DNSReply *make_dnsreply(struct reslist *request)
|
||||||
struct DNSReply *cp;
|
struct DNSReply *cp;
|
||||||
s_assert(request != 0);
|
s_assert(request != 0);
|
||||||
|
|
||||||
cp = (struct DNSReply *)MyMalloc(sizeof(struct DNSReply));
|
cp = (struct DNSReply *)rb_malloc(sizeof(struct DNSReply));
|
||||||
|
|
||||||
cp->h_name = request->name;
|
cp->h_name = request->name;
|
||||||
memcpy(&cp->addr, &request->addr, sizeof(cp->addr));
|
memcpy(&cp->addr, &request->addr, sizeof(cp->addr));
|
||||||
|
|
|
@ -153,7 +153,7 @@ clear_s_newconf_bans(void)
|
||||||
struct remote_conf *
|
struct remote_conf *
|
||||||
make_remote_conf(void)
|
make_remote_conf(void)
|
||||||
{
|
{
|
||||||
struct remote_conf *remote_p = MyMalloc(sizeof(struct remote_conf));
|
struct remote_conf *remote_p = rb_malloc(sizeof(struct remote_conf));
|
||||||
return remote_p;
|
return remote_p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ cluster_generic(struct Client *source_p, const char *command,
|
||||||
struct oper_conf *
|
struct oper_conf *
|
||||||
make_oper_conf(void)
|
make_oper_conf(void)
|
||||||
{
|
{
|
||||||
struct oper_conf *oper_p = MyMalloc(sizeof(struct oper_conf));
|
struct oper_conf *oper_p = rb_malloc(sizeof(struct oper_conf));
|
||||||
return oper_p;
|
return oper_p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ get_oper_privs(int flags)
|
||||||
struct server_conf *
|
struct server_conf *
|
||||||
make_server_conf(void)
|
make_server_conf(void)
|
||||||
{
|
{
|
||||||
struct server_conf *server_p = MyMalloc(sizeof(struct server_conf));
|
struct server_conf *server_p = rb_malloc(sizeof(struct server_conf));
|
||||||
server_p->aftype = AF_INET;
|
server_p->aftype = AF_INET;
|
||||||
return server_p;
|
return server_p;
|
||||||
}
|
}
|
||||||
|
@ -801,7 +801,7 @@ add_tgchange(const char *host)
|
||||||
if(find_tgchange(host))
|
if(find_tgchange(host))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
target = MyMalloc(sizeof(tgchange));
|
target = rb_malloc(sizeof(tgchange));
|
||||||
pnode = make_and_lookup(tgchange_tree, host);
|
pnode = make_and_lookup(tgchange_tree, host);
|
||||||
|
|
||||||
pnode->data = target;
|
pnode->data = target;
|
||||||
|
|
|
@ -214,7 +214,7 @@ collect_zipstats(void *unused)
|
||||||
/* only bother if we haven't already got something queued... */
|
/* only bother if we haven't already got something queued... */
|
||||||
if(!target_p->localClient->slinkq)
|
if(!target_p->localClient->slinkq)
|
||||||
{
|
{
|
||||||
target_p->localClient->slinkq = MyMalloc(1); /* sigh.. */
|
target_p->localClient->slinkq = rb_malloc(1); /* sigh.. */
|
||||||
target_p->localClient->slinkq[0] = SLINKCMD_ZIPSTATS;
|
target_p->localClient->slinkq[0] = SLINKCMD_ZIPSTATS;
|
||||||
target_p->localClient->slinkq_ofs = 0;
|
target_p->localClient->slinkq_ofs = 0;
|
||||||
target_p->localClient->slinkq_len = 1;
|
target_p->localClient->slinkq_len = 1;
|
||||||
|
@ -1247,7 +1247,7 @@ start_io(struct Client *server)
|
||||||
int linecount = 0;
|
int linecount = 0;
|
||||||
int linelen;
|
int linelen;
|
||||||
|
|
||||||
iobuf = MyMalloc(256); /* XXX: This seems arbitrary. Perhaps make it IRCD_BUFSIZE? --nenolod */
|
iobuf = rb_malloc(256); /* XXX: This seems arbitrary. Perhaps make it IRCD_BUFSIZE? --nenolod */
|
||||||
|
|
||||||
if(IsCapable(server, CAP_ZIP))
|
if(IsCapable(server, CAP_ZIP))
|
||||||
{
|
{
|
||||||
|
|
|
@ -99,7 +99,7 @@ find_or_add(const char *name)
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = (struct scache_entry *) MyMalloc(sizeof(struct scache_entry));
|
ptr = (struct scache_entry *) rb_malloc(sizeof(struct scache_entry));
|
||||||
s_assert(0 != ptr);
|
s_assert(0 != ptr);
|
||||||
|
|
||||||
strlcpy(ptr->name, name, sizeof(ptr->name));
|
strlcpy(ptr->name, name, sizeof(ptr->name));
|
||||||
|
|
|
@ -57,7 +57,7 @@ struct substitution_variable
|
||||||
*/
|
*/
|
||||||
void substitution_append_var(rb_dlink_list *varlist, const char *name, const char *value)
|
void substitution_append_var(rb_dlink_list *varlist, const char *name, const char *value)
|
||||||
{
|
{
|
||||||
struct substitution_variable *tmp = MyMalloc(sizeof(struct substitution_variable));
|
struct substitution_variable *tmp = rb_malloc(sizeof(struct substitution_variable));
|
||||||
|
|
||||||
DupString(tmp->name, name);
|
DupString(tmp->name, name);
|
||||||
DupString(tmp->value, value);
|
DupString(tmp->value, value);
|
||||||
|
|
|
@ -103,7 +103,7 @@ add_isupport(const char *name, const char *(*func)(const void *), const void *pa
|
||||||
{
|
{
|
||||||
struct isupportitem *item;
|
struct isupportitem *item;
|
||||||
|
|
||||||
item = MyMalloc(sizeof(struct isupportitem));
|
item = rb_malloc(sizeof(struct isupportitem));
|
||||||
item->name = name;
|
item->name = name;
|
||||||
item->func = func;
|
item->func = func;
|
||||||
item->param = param;
|
item->param = param;
|
||||||
|
|
Loading…
Add table
Reference in a new issue