X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Frwho%2Fserv_rwho.c;fp=citadel%2Fmodules%2Frwho%2Fserv_rwho.c;h=515c5f6afa7f14e79480fbeed05c139346b3ceb1;hb=e5f3baf6c110760b7a8a205dda834b1c4a2446e5;hp=06f439081aa4c69fb9b631233bc5ca2f3b995d35;hpb=bb4db7b4e2620965dd7a57984d8f7d07ca4b4806;p=citadel.git diff --git a/citadel/modules/rwho/serv_rwho.c b/citadel/modules/rwho/serv_rwho.c index 06f439081..515c5f6af 100644 --- a/citadel/modules/rwho/serv_rwho.c +++ b/citadel/modules/rwho/serv_rwho.c @@ -68,8 +68,7 @@ void cmd_rwho(char *argbuf) { */ - nContexts = num_sessions; - nptr = malloc(sizeof(struct CitContext) * nContexts); + nptr = CtdlGetContextArray(&nContexts) ; if (!nptr) { /* Couldn't malloc so we have to bail but stick to the protocol */ @@ -77,12 +76,6 @@ void cmd_rwho(char *argbuf) { cprintf("000\n"); return; } - begin_critical_section(S_SESSION_TABLE); - for (cptr = ContextList, i=0; cptr != NULL && i < nContexts; cptr = cptr->next, i++) - { - memcpy(&nptr[i], cptr, sizeof (struct CitContext)); - } - end_critical_section (S_SESSION_TABLE); aide = CC->user.axlevel >= 6; cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );