]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
MyMalloc -> rb_malloc
authorValery Yatsko <redacted>
Tue, 1 Apr 2008 23:07:29 +0000 (03:07 +0400)
committerValery Yatsko <redacted>
Tue, 1 Apr 2008 23:07:29 +0000 (03:07 +0400)
24 files changed:
modules/m_challenge.c
modules/m_gline.c
modules/m_list.c
src/blacklist.c
src/class.c
src/client.c
src/hash.c
src/hook.c
src/hostmask.c
src/irc_dictionary.c
src/irc_string.c
src/ircd_parser.y
src/kdparse.c
src/listener.c
src/modules.c
src/newconf.c
src/packet.c
src/reject.c
src/res.c
src/s_newconf.c
src/s_serv.c
src/scache.c
src/substitution.c
src/supported.c

index c5ed7c1fb0198c0aad13dd549e00b9003ea42af6..bb4ff39abf06d25fc62a63db5e545efcf3782159 100644 (file)
@@ -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), 
                           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.");
@@ -286,11 +286,11 @@ generate_challenge(char **r_challenge, char **r_response, RSA * rsa)
        {
                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)
index 4f39befc142359d6f01368db73e957f1f0b01dc7..ad737a0726efe1f80975f8bb480ec8402eed80ac 100644 (file)
@@ -660,7 +660,7 @@ majority_gline(struct Client *source_p, const char *user,
 
        /* 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));
index 1b93f43da6c6b67a99894caa42b44a788962ba61..9b15f8114f077e17ecaff7a6735a59e4f9eb4ebb 100644 (file)
@@ -249,7 +249,7 @@ static void safelist_client_instantiate(struct Client *client_p, struct ListClie
        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;
index 7645545e4d111894b2f27ae6697665a758be144d..c4dfe31f9f021518a2b0621041875017b998a6ef 100644 (file)
@@ -116,7 +116,7 @@ static void blacklist_dns_callback(void *vptr, struct DNSReply *reply)
 /* 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];
 
@@ -149,7 +149,7 @@ struct Blacklist *new_blacklist(char *name, char *reject_reason)
        blptr = find_blacklist(name);
        if (blptr == NULL)
        {
-               blptr = MyMalloc(sizeof(struct Blacklist));
+               blptr = rb_malloc(sizeof(struct Blacklist));
                rb_dlinkAddAlloc(blptr, &blacklist_list);
        }
        else
index 106d1468bf41ef4c7ee957c81e7b90bb3a4954f0..c32bd3abb457d6c11f45ba18fcfde66e9ef5a4f9 100644 (file)
@@ -49,7 +49,7 @@ make_class(void)
 {
        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;
index e035c0cf3326425d37cbc292cad46462cab7f4e3..c2ae48219e579120b1c505cb0ee2d8c4862ccdf7 100644 (file)
@@ -1301,7 +1301,7 @@ dead_link(struct Client *client_p)
        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));
@@ -1888,7 +1888,7 @@ make_server(struct Client *client_p)
 
        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;
index bf17b06661ee29400f8bbe7681a168c1f677b245..48ed950a30c6ac4ffb9c01b7e6fb36c21e70b5e9 100644 (file)
@@ -89,11 +89,11 @@ rb_dlink_list *hostTable;
 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
index 8e92bdaed1286d39894dab991d7ac796346fc934..ea2ecdaafb52dd1674b847923f11e1d8e865d4ea 100644 (file)
@@ -66,7 +66,7 @@ int h_introduce_client;
 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");
@@ -94,7 +94,7 @@ grow_hooktable(void)
 {
        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);
index cbbb0e98a162920a284a0c9cc78837ca82ef5b9b..d00aeb7c48e7f2a76e54e486a725923e2ae79925 100644 (file)
@@ -446,7 +446,7 @@ find_exact_conf_by_address(const char *address, int type, const char *username)
 
        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)
@@ -503,7 +503,7 @@ add_conf_by_address(const char *address, int type, const char *username, struct
 
        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;
index 06b115a378aa234335e56b534cefbfe99b252807..7429782183a6cb05b6d62ff1fb13b4a9ab1cb8e7 100644 (file)
@@ -57,7 +57,7 @@ struct Dictionary
  */
 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;
 
@@ -87,7 +87,7 @@ struct Dictionary *irc_dictionary_create(DCF 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);
index 90c21d103cc4dab1e37f8a888acdde964647f4e3..a32c1ccbbe2bc6c09a7890c1c57945c1456f0a87 100644 (file)
@@ -218,7 +218,7 @@ ircd_base64_encode(const unsigned char *str, int length)
                return NULL;
        }
 
-       result = MyMalloc(((length + 2) / 3) * 5);
+       result = rb_malloc(((length + 2) / 3) * 5);
        p = result;
 
        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;
        unsigned char *result;
        
-       result = MyMalloc(length + 1);
+       result = rb_malloc(length + 1);
 
        while ((ch = *current++) != '\0' && length-- > 0) {
                if (ch == base64_pad) break;
index 95731cc3337c1c4ccc8214a7e7bf658dde443123..0f80617f018d128eb0306948c7288e5e9e159b4d 100644 (file)
@@ -124,7 +124,7 @@ static void add_cur_list_cpt(conf_parm_t *new)
 {
        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;
        }
@@ -139,7 +139,7 @@ static void add_cur_list(int type, char *str, int number)
 {
        conf_parm_t *new;
 
-       new = MyMalloc(sizeof(conf_parm_t));
+       new = rb_malloc(sizeof(conf_parm_t));
        new->next = NULL;
        new->type = type;
 
@@ -253,19 +253,19 @@ single: oneitem
 
 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;
            }
@@ -275,7 +275,7 @@ oneitem: qstring
                   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)
                {
index b94bb507b7ec54ad13e18ae22c33432194897786..ea12d59436052549f35ecedd8963b2bb92784933 100644 (file)
@@ -50,7 +50,7 @@ conf_add_fields(struct ConfItem *aconf,       const char *host_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);
                }
                else
index 7410f21b496c70cec368b3e4b606ada5fd568b0d..304b51cf6705dee437aed274bee2ae1e809a910c 100644 (file)
@@ -58,7 +58,7 @@ static listener_t *ListenerPollList = NULL;
 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;
index b8f42c4bbfdf41ce577d57a1957a4dab52dc9313..62aff19eee1f136d6e0fb1beaedbc3e0e50cacd5 100644 (file)
@@ -164,7 +164,7 @@ mod_add_path(const char *path)
        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);
@@ -200,7 +200,7 @@ mod_clear_paths(void)
 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, '/')))
@@ -248,7 +248,7 @@ load_all_modules(int warn)
 
        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;
 
@@ -888,7 +888,7 @@ load_a_module(const char *path, int warn, int core)
 
        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;
@@ -925,7 +925,7 @@ increase_modlist(void)
        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);
 
index 665b49b7c27bcddefbb4e1eb619db5053276e976..eddeeff674beedcb41e857cf3fe4342dce86d731 100644 (file)
@@ -80,7 +80,7 @@ add_top_conf(const char *name, int (*sfunc) (struct TopConf *),
 {
        struct TopConf *tc;
 
-       tc = MyMalloc(sizeof(struct TopConf));
+       tc = rb_malloc(sizeof(struct TopConf));
 
        tc->tc_name = name;
        tc->tc_sfunc = sfunc;
@@ -1582,7 +1582,7 @@ conf_set_service_name(void *data)
 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);
@@ -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)
                return -1;
 
-       cf = MyMalloc(sizeof(struct ConfEntry));
+       cf = rb_malloc(sizeof(struct ConfEntry));
 
        cf->cf_name = name;
        cf->cf_type = type;
index bc1a0f5651956efa3407c02d70a6dfbd346557a9..038ddca3cc653c63b2d10d7a5d0fc7f256d1fb65 100644 (file)
@@ -282,7 +282,7 @@ read_ctrl_packet(int fd, void *data)
                        reply->datalen |= *len;
                        reply->gotdatalen++;
                        if(reply->datalen > 0)
-                               reply->data = MyMalloc(reply->datalen);
+                               reply->data = rb_malloc(reply->datalen);
                }
 
                if(reply->gotdatalen < 2)
index aaf8fab009f54459953a1aa1489d33040e63c535..86897b4dc9dab30f2967b9ca80605232e2da1866 100644 (file)
@@ -148,7 +148,7 @@ add_reject(struct Client *client_p, const char *mask1, const char *mask2)
                        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;
index 63318714d5952cb74948b47d3f12287c18240bd4..356e838e504777fe70ee2ed82dd1edb882b03e13 100644 (file)
--- a/src/res.c
+++ b/src/res.c
@@ -296,7 +296,7 @@ static void rem_request(struct reslist *request)
  */
 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;
@@ -411,7 +411,7 @@ static void do_query_name(struct DNSQuery *query, const char *name, struct resli
        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;
        }
@@ -433,7 +433,7 @@ static void do_query_number(struct DNSQuery *query, const struct irc_sockaddr_st
        {
                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)
@@ -848,7 +848,7 @@ static struct DNSReply *make_dnsreply(struct reslist *request)
        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));
index e67911bfaf04195b8a98450d0be0a8441c46a779..1c9e289c022589192b1cda4ccc755ada3d8a24b2 100644 (file)
@@ -153,7 +153,7 @@ clear_s_newconf_bans(void)
 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;
 }
 
@@ -246,7 +246,7 @@ cluster_generic(struct Client *source_p, const char *command,
 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;
 }
 
@@ -369,7 +369,7 @@ get_oper_privs(int flags)
 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;
 }
@@ -801,7 +801,7 @@ add_tgchange(const char *host)
        if(find_tgchange(host))
                return;
 
-       target = MyMalloc(sizeof(tgchange));
+       target = rb_malloc(sizeof(tgchange));
        pnode = make_and_lookup(tgchange_tree, host);
 
        pnode->data = target;
index 72e7925e6356a2e401cfab4cc706b9144afd0f85..0571237fa6aa3a08da0926397272a87d22ce1add 100644 (file)
@@ -214,7 +214,7 @@ collect_zipstats(void *unused)
                        /* 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;
@@ -1247,7 +1247,7 @@ start_io(struct Client *server)
        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))
        {
index 8617743e587a40847f1d6532d13ddd2e073efa01..49c9f3b38b1746c34e7347f266e058b4ea42cd8e 100644 (file)
@@ -99,7 +99,7 @@ find_or_add(const char *name)
                        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));
index 5cef86b09a914eb262b04241e86cd8e14f46f15c..58deefabc30a2f9a4a5d60a13a356a3cb0236ba0 100644 (file)
@@ -57,7 +57,7 @@ struct substitution_variable
  */
 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);
index d0a24d523ebe6a85bacfcd51d881d3a43c698050..001a19201b55787ee921ed9f5e98c86b9e33b2af 100644 (file)
@@ -103,7 +103,7 @@ add_isupport(const char *name, const char *(*func)(const void *), const void *pa
 {
        struct isupportitem *item;
 
-       item = MyMalloc(sizeof(struct isupportitem));
+       item = rb_malloc(sizeof(struct isupportitem));
        item->name = name;
        item->func = func;
        item->param = param;