This is an automated email from the ASF dual-hosted git repository.
boroknagyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push:
new 850f2cf36 IMPALA-14443: Fix potential memory leak in TmpFileMgr
850f2cf36 is described below
commit 850f2cf3618fe5a667949c445c1fc8a506592a9f
Author: Zoltan Borok-Nagy <[email protected]>
AuthorDate: Tue Sep 16 15:53:33 2025 +0200
IMPALA-14443: Fix potential memory leak in TmpFileMgr
Clang static analyzer found a potential memory leak in
TmpFileMgr. In some cases we forget the deletion of a
newly created TmpFileRemote object. This patch replaces
the raw pointer with a unique_ptr.
Change-Id: I5a516eab1a946e7368c6059f8d1cc430d2ee19e9
Reviewed-on: http://gerrit.cloudera.org:8080/23431
Reviewed-by: Riza Suminto <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
be/src/runtime/tmp-file-mgr.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/be/src/runtime/tmp-file-mgr.cc b/be/src/runtime/tmp-file-mgr.cc
index 494012bde..529a51e74 100644
--- a/be/src/runtime/tmp-file-mgr.cc
+++ b/be/src/runtime/tmp-file-mgr.cc
@@ -1475,7 +1475,7 @@ Status TmpFileGroup::AllocateRemoteSpace(int64_t
num_bytes, TmpFile** tmp_file,
const string& local_buffer_dir = tmp_file_mgr_->local_buff_dir_->path();
string new_file_path_local = GenerateNewPath(local_buffer_dir, unique_name);
- TmpFileRemote* tmp_file_r = new TmpFileRemote(
+ unique_ptr<TmpFileRemote> tmp_file_r = make_unique<TmpFileRemote>(
this, dev_id, new_file_path, new_file_path_local, false, dir.c_str());
if (tmp_file_r == nullptr) {
return Status("Failed to allocate temporary file object.");