HttpRequest: fix potential memleak


The logic of cleaning up QFile instances relies on the fact that
they are added to the addedFiles list, and later their parent is
set to a non-null QObject.

However, if the file could not be opened, it was not added to the
list. We were leaking memory in such case. Use std::unique_ptr to
manage the lifetime of the file, and release() it when adding the
file to the list.

As a drive-by: use std::as_const() when iterating over the list of
files to prevent detaches.

Change-Id: I1399c69a2bac19f82334525de606702180e98771
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
commitd15db2c56ce31c6eb2ad3745a777b268d346ec9d
parentfa4205a09329a1974263f475790b0f3efc0da93f
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeWed, 10 Sep 2025 11:53:11 +0200