if (!s || !d)
return;
- l = safe_calloc (1, sizeof (LIST));
+ l = mem_calloc (1, sizeof (LIST));
if (s->list)
s->tail->next = l;
else
strfcpy (group, line, len);
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, group)) == NULL) {
data =
- (NNTP_DATA *) safe_calloc (1, sizeof (NNTP_DATA) + str_len (group) + 1);
+ (NNTP_DATA *) mem_calloc (1, sizeof (NNTP_DATA) + str_len (group) + 1);
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
nntp_add_to_list (news, data);
}
else
- FREE ((void **) &data->entries);
+ mem_free ((void **) &data->entries);
data->rc = 1;
- data->entries = safe_calloc (x * 2, sizeof (NEWSRC_ENTRY));
+ data->entries = mem_calloc (x * 2, sizeof (NEWSRC_ENTRY));
data->max = x * 2;
if (*p == ':')
return -1;
}
- buf = safe_malloc (sb.st_size + 1);
+ buf = mem_malloc (sb.st_size + 1);
while (fgets (buf, sb.st_size + 1, fp))
nntp_parse_newsrc_line (news, buf);
- FREE (&buf);
+ mem_free (&buf);
mx_unlock_file (news->newsrc, fileno (fp), 0);
fclose (fp);
set_option (OPTNEWSCACHE);
- FREE (&news->cache);
+ mem_free (&news->cache);
snprintf (buf, sizeof (buf), "%s/.index", dir);
if (!(index = safe_fopen (buf, "a+")))
return 0;
else if (news->newsgroups) {
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, buf)) == NULL) {
data =
- (NNTP_DATA *) safe_calloc (1,
+ (NNTP_DATA *) mem_calloc (1,
sizeof (NNTP_DATA) + str_len (buf) + 1);
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, buf);
ret = mutt_account_fromurl (acct, &url);
}
- FREE (&c);
+ mem_free (&c);
return ret;
}
url.path = str_dup (line);
mutt_account_tourl (acct, &url);
url_ciss_tostring (&url, line, len, 0);
- FREE (&url.path);
+ mem_free (&url.path);
}
/*
return NULL;
}
- buf = p = safe_calloc (str_len (server) + 10, sizeof (char));
+ buf = p = mem_calloc (str_len (server) + 10, sizeof (char));
if (url_check_scheme (server) == U_UNKNOWN) {
strcpy (buf, "nntp://");
p = strchr (buf, '\0');
strcpy (p, server);
if ((nntp_parse_url (buf, &acct, file, sizeof (file))) < 0 || *file) {
- FREE (&buf);
+ mem_free (&buf);
mutt_error (_("%s is an invalid newsserver specification!"), server);
return NULL;
}
- FREE (&buf);
+ mem_free (&buf);
conn = mutt_conn_find (NULL, &acct);
if (!conn)
}
/* New newsserver */
- serv = safe_calloc (1, sizeof (NNTP_SERVER));
+ serv = mem_calloc (1, sizeof (NNTP_SERVER));
serv->conn = conn;
serv->newsrc = str_dup (file);
serv->newsgroups = hash_create (1009);
for (list = serv->list; list; list = list->next)
list->data = NULL;
mutt_free_list (&serv->list);
- FREE (&serv->newsrc);
- FREE (&serv->cache);
- FREE (&serv);
+ mem_free (&serv->newsrc);
+ mem_free (&serv->cache);
+ mem_free (&serv);
return NULL;
}
nntp_clear_cacheindex (serv);
len += *buflen;
*buflen *= 2;
line = *buf;
- safe_realloc (buf, *buflen);
+ mem_realloc (buf, *buflen);
line = *buf + (*pline - line);
}
strcpy (line, data->group);
*buflen *= 2;
*pline = line;
line = *buf;
- safe_realloc (buf, *buflen);
+ mem_realloc (buf, *buflen);
line = *buf + (*pline - line);
}
if (x) {
}
if (!data->max) {
- data->entries = safe_calloc (5, sizeof (NEWSRC_ENTRY));
+ data->entries = mem_calloc (5, sizeof (NEWSRC_ENTRY));
data->max = 5;
}
!ctx->hdrs[x]->read) {
if (data->num >= data->max) {
data->max = data->max * 2;
- safe_realloc (&data->entries, data->max * sizeof (NEWSRC_ENTRY));
+ mem_realloc (&data->entries, data->max * sizeof (NEWSRC_ENTRY));
}
data->entries[data->num].first = first;
data->entries[data->num].last = last - 1;
if (series && first <= data->lastLoaded) {
if (data->num >= data->max) {
data->max = data->max * 2;
- safe_realloc (&data->entries, data->max * sizeof (NEWSRC_ENTRY));
+ mem_realloc (&data->entries, data->max * sizeof (NEWSRC_ENTRY));
}
data->entries[data->num].first = first;
data->entries[data->num].last = data->lastLoaded;
if (!news)
return -1;
llen = len = 10 * LONG_STRING;
- line = buf = safe_calloc (1, len);
+ line = buf = mem_calloc (1, len);
/* we will generate full newsrc here */
for (tmp = news->list; tmp; tmp = tmp->next) {
data = (NNTP_DATA *) tmp->data;
news->size = st.st_size;
news->mtime = st.st_mtime;
}
- FREE (&buf);
+ mem_free (&buf);
return r;
}
nntp_cache_expand (buf, data->cache);
unlink (buf);
- FREE (&data->cache);
+ mem_free (&data->cache);
data->lastCached = 0;
nntp_cache_expand (buf, ".index");
mutt_update_list_file (buf, data->nserv->conn->account.host, data->group,
return NULL;
if (!(data = (NNTP_DATA *) hash_find (news->newsgroups, group))) {
data =
- (NNTP_DATA *) safe_calloc (1, sizeof (NNTP_DATA) + str_len (group) + 1);
+ (NNTP_DATA *) mem_calloc (1, sizeof (NNTP_DATA) + str_len (group) + 1);
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
!(data = (NNTP_DATA *) hash_find (news->newsgroups, group)))
return NULL;
if (!data->max) {
- data->entries = safe_calloc (5, sizeof (NEWSRC_ENTRY));
+ data->entries = mem_calloc (5, sizeof (NEWSRC_ENTRY));
data->max = 5;
}
data->num = 1;
!(data = (NNTP_DATA *) hash_find (news->newsgroups, group)))
return NULL;
if (!data->max) {
- data->entries = safe_calloc (5, sizeof (NEWSRC_ENTRY));
+ data->entries = mem_calloc (5, sizeof (NEWSRC_ENTRY));
data->max = 5;
}
data->num = 1;