summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2b60a54)
If the fopen() succeeded, but the fwrite() failed, then the FILE wasn't
fclose()'d.
CT tmp_ct;
char *tmp_file;
FILE *tmp_f;
CT tmp_ct;
char *tmp_file;
FILE *tmp_f;
/* Truncate buffer to just the C-T. */
*end_of_header = '\0';
/* Truncate buffer to just the C-T. */
*end_of_header = '\0';
reply, which we'll use below. */
tmp_file = getcpy (m_mktemp2 (NULL, invo_name, NULL, NULL));
tmp_f = fopen(tmp_file, "w");
reply, which we'll use below. */
tmp_file = getcpy (m_mktemp2 (NULL, invo_name, NULL, NULL));
tmp_f = fopen(tmp_file, "w");
- if (!tmp_f || fwrite(buffer, 1, n, tmp_f) != n)
+ if (!tmp_f)
+ goto failed_to_extract_ct;
+ written = fwrite(buffer, 1, n, tmp_f);
+ fclose(tmp_f);
+ if (written != n)
goto failed_to_extract_ct;
goto failed_to_extract_ct;
tmp_ct = parse_mime (tmp_file);
if (tmp_ct) {
tmp_ct = parse_mime (tmp_file);
if (tmp_ct) {