mutt_perror (tmpfile);
break;
}
- if (fclose (fp) == EOF)
+ if (safe_fclose (&fp) == EOF)
{
mutt_perror (tmpfile);
fp = NULL;
break;
}
if (fp)
- fclose (fp);
+ safe_fclose (&fp);
if (*tmpfile)
unlink (tmpfile);
if (rc)
if (fgets (buf, sizeof (buf), fp) == NULL ||
sscanf (buf, "%ld%s", &t, file) != 1 || t == 0)
{
- fclose (fp);
+ safe_fclose (&fp);
return -1;
}
nserv->newgroups_time = t;
while (fgets (buf, sizeof (buf), fp))
nntp_add_group (buf, nserv);
nntp_add_group (NULL, NULL);
- fclose (fp);
+ safe_fclose (&fp);
mutt_clear_error ();
return 0;
}
{
if (strstr (header, ":full") == NULL && fputs (header, fp) == EOF)
{
- fclose (fp);
+ safe_fclose (&fp);
unlink (tempfile);
return -1;
}
*field++ = '\0';
if (fputs (b, fp) == EOF || fputc ('\n', fp) == EOF)
{
- fclose (fp);
+ safe_fclose (&fp);
unlink (tempfile);
return -1;
}
hdr->env = mutt_read_rfc822_header (fp, hdr, 0, 0);
hdr->env->newsgroups = safe_strdup (nntp_data->group);
hdr->received = hdr->date_sent;
- fclose (fp);
+ safe_fclose (&fp);
unlink (tempfile);
#ifdef USE_HCACHE
fetch_tempfile, fp);
if (rc)
{
- fclose (fp);
+ safe_fclose (&fp);
unlink (tempfile);
if (rc < 0)
break;
hdr = ctx->hdrs[ctx->msgcount] = mutt_new_header ();
hdr->env = mutt_read_rfc822_header (fp, hdr, 0, 0);
hdr->received = hdr->date_sent;
- fclose (fp);
+ safe_fclose (&fp);
unlink (tempfile);
}
{
if (acache->index == hdr->index)
{
- msg->fp = fopen (acache->path, "r");
+ msg->fp = safe_fopen (acache->path, "r");
if (msg->fp)
return 0;
}
buf[1] == '.' ? buf : buf + 1, -1, MUTT_SOCK_LOG_HDR) < 0)
return nntp_connect_error (nntp_data->nserv);
}
- fclose (fp);
+ safe_fclose (&fp);
if ((buf[strlen (buf) - 1] != '\n' &&
mutt_socket_write_d (nntp_data->nserv->conn, "\r\n", -1, MUTT_SOCK_LOG_HDR) < 0) ||
fetch_tempfile, fp);
if (rc)
{
- fclose (fp);
+ safe_fclose (&fp);
unlink (tempfile);
if (rc < 0)
return -1;
hdr = ctx->hdrs[ctx->msgcount] = mutt_new_header ();
hdr->data = safe_calloc (1, sizeof (NNTP_HEADER_DATA));
hdr->env = mutt_read_rfc822_header (fp, hdr, 0, 0);
- fclose (fp);
+ safe_fclose (&fp);
unlink (tempfile);
/* get article number */