]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
send_help: fix FILE* leak in send_help_noexit
authorMichael S. Tsirkin <mst@redhat.com>
Fri, 9 Jan 2026 10:24:34 +0000 (05:24 -0500)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Fri, 13 Feb 2026 13:28:23 +0000 (14:28 +0100)
Add missing fclose(mail.fp) after send_single_mail(). The file is
opened with fopen() but never closed before returning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
src/send_help.c

index cf47ccf5a4b642d982b8ef6516f40e4e358509c6..61aa49bc49c9e9b85808e5a46bf452a392b025a1 100644 (file)
@@ -45,6 +45,8 @@ send_help_noexit(struct ml *ml, const char *queuefilename, const char *emailaddr
                save_queue(queuefilename, &mail);
        else
                unlink(queuefilename);
+       if (mail.fp)
+               fclose(mail.fp);
 }
 
 void