]> jfr.im git - solanum.git/blobdiff - src/client.c
MyMalloc -> rb_malloc
[solanum.git] / src / client.c
index 6830bde50ac0ed42ee0a67e3a96e80fcb88c6a80..c2ae48219e579120b1c505cb0ee2d8c4862ccdf7 100644 (file)
@@ -223,13 +223,13 @@ free_local_client(struct Client *client_p)
        {
                memset(client_p->localClient->passwd, 0,
                        strlen(client_p->localClient->passwd));
-               MyFree(client_p->localClient->passwd);
+               rb_free(client_p->localClient->passwd);
        }
 
-       MyFree(client_p->localClient->challenge);
-       MyFree(client_p->localClient->fullcaps);
-       MyFree(client_p->localClient->opername);
-       MyFree(client_p->localClient->mangledhost);
+       rb_free(client_p->localClient->challenge);
+       rb_free(client_p->localClient->fullcaps);
+       rb_free(client_p->localClient->opername);
+       rb_free(client_p->localClient->mangledhost);
 
        BlockHeapFree(lclient_heap, client_p->localClient);
        client_p->localClient = NULL;
@@ -791,8 +791,8 @@ release_client_state(struct Client *client_p)
                if(client_p->serv->user != NULL)
                        free_user(client_p->serv->user, client_p);
                if(client_p->serv->fullcaps)
-                       MyFree(client_p->serv->fullcaps);
-               MyFree(client_p->serv);
+                       rb_free(client_p->serv->fullcaps);
+               rb_free(client_p->serv);
        }
 }
 
@@ -1283,7 +1283,7 @@ exit_aborted_clients(void *unused)
                 */
                abt->client->flags &= ~FLAGS_CLOSING;
                exit_client(abt->client, abt->client, &me, abt->notice);
-               MyFree(abt);
+               rb_free(abt);
        }
 }
 
@@ -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;
@@ -1909,7 +1909,7 @@ free_user(struct User *user, struct Client *client_p)
        if(--user->refcnt <= 0)
        {
                if(user->away)
-                       MyFree((char *) user->away);
+                       rb_free((char *) user->away);
                /*
                 * sanity check
                 */
@@ -1936,6 +1936,23 @@ free_user(struct User *user, struct Client *client_p)
        }
 }
 
+void\r
+allocate_away(struct Client *client_p)\r
+{\r
+       if(client_p->user->away == NULL)\r
+               client_p->user->away = rb_bh_alloc(away_heap);  \r
+}\r
+\r
+\r
+void\r
+free_away(struct Client *client_p)\r
+{\r
+       if(client_p->user->away != NULL) {\r
+               rb_bh_free(away_heap, client_p->user->away);\r
+               client_p->user->away = NULL;\r
+       }\r
+}
+
 void
 init_uid(void)
 {