sendto_one(source_p, form_str(RPL_ENDOFRSACHALLENGE2),
me.name, source_p->name);
rb_free(challenge);
- DupString(source_p->localClient->opername, oper_p->name);
+ source_p->localClient->opername = rb_strdup(oper_p->name);
}
else
sendto_one_notice(source_p, ":Failed to generate challenge.");
{
SHA1_Init(&ctx);
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);
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);
if (ret >= 0)
/* no pending gline, create a new one */
pending = (struct gline_pending *)
- MyMalloc(sizeof(struct gline_pending));
+ rb_malloc(sizeof(struct gline_pending));
strlcpy(pending->oper_nick1, source_p->name,
sizeof(pending->oper_nick1));
s_assert(MyClient(client_p));
s_assert(params != NULL);
- self = MyMalloc(sizeof(struct ListClient));
+ self = rb_malloc(sizeof(struct ListClient));
self->hash_indice = 0;
self->users_min = params->users_min;
/* XXX: no IPv6 implementation, not to concerned right now though. */
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];
int ip[4];
blptr = find_blacklist(name);
if (blptr == NULL)
{
- blptr = MyMalloc(sizeof(struct Blacklist));
+ blptr = rb_malloc(sizeof(struct Blacklist));
rb_dlinkAddAlloc(blptr, &blacklist_list);
}
else
{
struct Class *tmp;
- tmp = (struct Class *) MyMalloc(sizeof(struct Class));
+ tmp = (struct Class *) rb_malloc(sizeof(struct Class));
ConFreq(tmp) = DEFAULT_CONNECTFREQUENCY;
PingFreq(tmp) = DEFAULT_PINGFREQUENCY;
if(IsDead(client_p) || IsClosing(client_p) || IsMe(client_p))
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)
strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
if(!serv)
{
- serv = (server_t *) MyMalloc(sizeof(server_t));
+ serv = (server_t *) rb_malloc(sizeof(server_t));
client_p->serv = serv;
}
return client_p->serv;
void
init_hash(void)
{
- clientTable = MyMalloc(sizeof(rb_dlink_list) * U_MAX);
- idTable = MyMalloc(sizeof(rb_dlink_list) * U_MAX);
- channelTable = MyMalloc(sizeof(rb_dlink_list) * CH_MAX);
- hostTable = MyMalloc(sizeof(rb_dlink_list) * HOST_MAX);
- resvTable = MyMalloc(sizeof(rb_dlink_list) * R_MAX);
+ clientTable = rb_malloc(sizeof(rb_dlink_list) * U_MAX);
+ idTable = rb_malloc(sizeof(rb_dlink_list) * U_MAX);
+ channelTable = rb_malloc(sizeof(rb_dlink_list) * CH_MAX);
+ hostTable = rb_malloc(sizeof(rb_dlink_list) * HOST_MAX);
+ resvTable = rb_malloc(sizeof(rb_dlink_list) * R_MAX);
}
#ifndef RICER_HASHING
void
init_hook(void)
{
- hooks = MyMalloc(sizeof(hook) * HOOK_INCREMENT);
+ hooks = rb_malloc(sizeof(hook) * HOOK_INCREMENT);
#ifdef USE_IODEBUG_HOOKS
h_iosend_id = register_hook("iosend");
{
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);
rb_free(hooks);
if(address == NULL)
address = "/NOMATCH!/";
- arec = MyMalloc(sizeof(struct AddressRec));
+ arec = rb_malloc(sizeof(struct AddressRec));
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
#ifdef IPV6
if(masktype == HM_IPV6)
if(address == NULL)
address = "/NOMATCH!/";
- arec = MyMalloc(sizeof(struct AddressRec));
+ arec = rb_malloc(sizeof(struct AddressRec));
masktype = parse_netmask(address, (struct sockaddr *)&arec->Mask.ipa.addr, &bits);
arec->Mask.ipa.bits = bits;
arec->masktype = masktype;
*/
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;
struct Dictionary *irc_dictionary_create_named(const char *name,
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;
DupString(dtree->id, name);
return NULL;
}
- result = MyMalloc(((length + 2) / 3) * 5);
+ result = rb_malloc(((length + 2) / 3) * 5);
p = result;
while (length > 2)
int ch, i = 0, j = 0, k;
unsigned char *result;
- result = MyMalloc(length + 1);
+ result = rb_malloc(length + 1);
while ((ch = *current++) != '\0' && length-- > 0) {
if (ch == base64_pad) break;
{
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->v.list = new;
}
{
conf_parm_t *new;
- new = MyMalloc(sizeof(conf_parm_t));
+ new = rb_malloc(sizeof(conf_parm_t));
new->next = NULL;
new->type = type;
oneitem: qstring
{
- $$ = MyMalloc(sizeof(conf_parm_t));
+ $$ = rb_malloc(sizeof(conf_parm_t));
$$->type = CF_QSTRING;
DupString($$->v.string, $1);
}
| timespec
{
- $$ = MyMalloc(sizeof(conf_parm_t));
+ $$ = rb_malloc(sizeof(conf_parm_t));
$$->type = CF_TIME;
$$->v.number = $1;
}
| number
{
- $$ = MyMalloc(sizeof(conf_parm_t));
+ $$ = rb_malloc(sizeof(conf_parm_t));
$$->type = CF_INT;
$$->v.number = $1;
}
so pass it as that, if so */
int val = conf_get_yesno_value($1);
- $$ = MyMalloc(sizeof(conf_parm_t));
+ $$ = rb_malloc(sizeof(conf_parm_t));
if (val != -1)
{
{
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);
}
else
static listener_t *
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);
listener->name = me.name;
if(mod_find_path(path))
return;
- pathst = MyMalloc(sizeof(struct module_path));
+ pathst = rb_malloc(sizeof(struct module_path));
strcpy(pathst->path, path);
rb_dlinkAddAlloc(pathst, &mod_paths);
char *
irc_basename(const char *path)
{
- char *mod_basename = MyMalloc(strlen(path) + 1);
+ char *mod_basename = rb_malloc(strlen(path) + 1);
const char *s;
if(!(s = strrchr(path, '/')))
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;
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]->version = ver;
modlist[num_mods]->core = core;
if((num_mods + 1) < max_mods)
return;
- new_modlist = (struct module **) MyMalloc(sizeof(struct module) *
+ new_modlist = (struct module **) rb_malloc(sizeof(struct module) *
(max_mods + MODS_INCREMENT));
memcpy((void *) new_modlist, (void *) modlist, sizeof(struct module) * num_mods);
{
struct TopConf *tc;
- tc = MyMalloc(sizeof(struct TopConf));
+ tc = rb_malloc(sizeof(struct TopConf));
tc->tc_name = name;
tc->tc_sfunc = sfunc;
static int
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)
DupString(yy_alias->name, conf_cur_block_name);
if((cf = find_conf_item(tc, name)) != NULL)
return -1;
- cf = MyMalloc(sizeof(struct ConfEntry));
+ cf = rb_malloc(sizeof(struct ConfEntry));
cf->cf_name = name;
cf->cf_type = type;
reply->datalen |= *len;
reply->gotdatalen++;
if(reply->datalen > 0)
- reply->data = MyMalloc(reply->datalen);
+ reply->data = rb_malloc(reply->datalen);
}
if(reply->gotdatalen < 2)
bitlen = 128;
#endif
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);
rdata->time = CurrentTime;
rdata->count = 1;
*/
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->retries = 3;
if (request == NULL)
{
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);
request->state = REQ_A;
}
{
request = make_request(query);
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)
struct DNSReply *cp;
s_assert(request != 0);
- cp = (struct DNSReply *)MyMalloc(sizeof(struct DNSReply));
+ cp = (struct DNSReply *)rb_malloc(sizeof(struct DNSReply));
cp->h_name = request->name;
memcpy(&cp->addr, &request->addr, sizeof(cp->addr));
struct remote_conf *
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;
}
struct oper_conf *
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;
}
struct server_conf *
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;
return server_p;
}
if(find_tgchange(host))
return;
- target = MyMalloc(sizeof(tgchange));
+ target = rb_malloc(sizeof(tgchange));
pnode = make_and_lookup(tgchange_tree, host);
pnode->data = target;
/* only bother if we haven't already got something queued... */
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_ofs = 0;
target_p->localClient->slinkq_len = 1;
int linecount = 0;
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))
{
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);
strlcpy(ptr->name, name, sizeof(ptr->name));
*/
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->value, value);
{
struct isupportitem *item;
- item = MyMalloc(sizeof(struct isupportitem));
+ item = rb_malloc(sizeof(struct isupportitem));
item->name = name;
item->func = func;
item->param = param;