Skip to content

BUG: Missing defer on temp file cleanup in attach handler #622

@andrinoff

Description

@andrinoff

Describe the bug: Temp files created for attachments may not be cleaned up if errors occur after creation.

To reproduce:

  1. Check attachment download code paths
  2. If error occurs after temp file created but before cleanup
  3. Temp files accumulate in system temp directory

Expected behavior: Use defer to ensure temp file cleanup even on error paths.

Additional context:

  • Review view/html.go and attachment handling code
  • Severity: Low-Medium - disk space leak
  • Fix: Add defer os.Remove after temp file creation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions