Attempt to open file later to prevent potential resource leak

This commit is contained in:
Michael Vetter
2025-03-06 11:19:00 +01:00
parent 0081db643f
commit 55a8a26a24

View File

@@ -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;