]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/client.c
Change strdup() to strndup()
[ngircd-alex.git] / src / ngircd / client.c
index 32690288529499097c0b6d88c1127774202f51bd..72774ca9f4c749449d40a9344393aa3f6eef54b0 100644 (file)
@@ -126,6 +126,8 @@ Client_Exit( void )
                next = (CLIENT *)c->next;
                if (c->account_name)
                        free(c->account_name);
+               if (c->cloaked)
+                       free(c->cloaked);
                free( c );
                c = next;
        }
@@ -467,7 +469,8 @@ Client_SetAccountName(CLIENT *Client, const char *AccountName)
                free(Client->account_name);
 
        if (*AccountName)
-               Client->account_name = strdup(AccountName);
+               Client->account_name = strndup(AccountName,
+                                              CLIENT_NICK_LEN - 1);
        else
                Client->account_name = NULL;
 }