From 55a8a26a24ef9590065da1e8fb8cdee5e81d36cc Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 6 Mar 2025 11:19:00 +0100 Subject: [PATCH] Attempt to open file later to prevent potential resource leak --- src/command/cmd_funcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 63e16415..51439237 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -4917,8 +4917,6 @@ cmd_sendfile(ProfWin* window, const char* const command, gchar** args) goto out; } - FILE* fh = fdopen(fd, "rb"); - gboolean omemo_enabled = FALSE; gboolean sendfile_enabled = TRUE; @@ -4952,6 +4950,8 @@ cmd_sendfile(ProfWin* window, const char* const command, gchar** args) goto out; } + FILE* fh = fdopen(fd, "rb"); + if (omemo_enabled) { #ifdef HAVE_OMEMO char* err = NULL;