- if ((nntp_data = (nntp_data_t *) hash_find (serv->newsgroups, buf)) == NULL) {
- nntp_data = xmalloc(sizeof(nntp_data_t) + m_strlen(buf) + 1);
- nntp_data->group = (char *) nntp_data + sizeof (nntp_data_t);
- strcpy (nntp_data->group, buf);
- hash_insert (serv->newsgroups, nntp_data->group, nntp_data);
+ if ((nntp_data = hash_find(serv->newsgroups, buf)) == NULL) {
+ nntp_data = nntp_data_new();
+ nntp_data->group = m_strdup(buf);
+ hash_insert(serv->newsgroups, nntp_data->group, nntp_data);