From ce29750de32795235d604ffcd92d13ff82c86c4b Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 20 Jun 2023 10:06:34 +0200 Subject: [PATCH] send_digest: fix double --- src/send_digest.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/send_digest.c b/src/send_digest.c index a66b97b8..aeab4597 100644 --- a/src/send_digest.c +++ b/src/send_digest.c @@ -324,7 +324,6 @@ int send_digest(struct ml *ml, int firstindex, int lastindex, tmp = unistr_utf8_to_header(tmp); xasprintf(&subject, "Subject: %s", tmp); free(tmp); - free(line); /* Skip the empty line after the subject */ line = get_processed_text_line(txt, true, ml); @@ -334,7 +333,7 @@ int send_digest(struct ml *ml, int firstindex, int lastindex, goto fallback_subject; } - if (line != NULL) free(line); + free(line); line = NULL; } else { log_error(LOG_ARGS, "No subject or invalid " @@ -415,12 +414,12 @@ errdighdrs: line = get_processed_text_line(txt, false, ml); if (line == NULL) break; if(dprintf(fd, "%s\n", line) < 0) { - free(line); log_error(LOG_ARGS, "Could not write" " std mail"); break; } free(line); + line = NULL; } finish_thread_list(tls); -- 2.47.2