]> www.dolda2000.com Git - ashd.git/commitdiff
sendfile: Fix file-descriptor leak in compression. master
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 12 Feb 2026 01:33:39 +0000 (02:33 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 12 Feb 2026 01:33:39 +0000 (02:33 +0100)
src/compress.c

index e1f05fa84c24a8014e875010822547932bb7ab7e..eabea8d261fc0a554a02a716440be5bb037b7bdd 100644 (file)
@@ -283,6 +283,8 @@ int ccopen(char *path, struct stat *sb, char *accept, const char **encoding)
                    msb.st_mtime = sb->st_mtime;
                    msb.st_ctime = sb->st_ctime;
                    mtype = type;
+               } else {
+                   close(efd);
                }
            }
        }