[applied] tools-utils: Fix a memory leak in find_file_under_dir

Message ID 87tt1zv0i8.fsf@redhat.com
State New
Headers
Series [applied] tools-utils: Fix a memory leak in find_file_under_dir |

Commit Message

Dodji Seketeli Aug. 22, 2025, 3:28 p.m. UTC
  Hello,

	* src/abg-tools-utils.cc (find_file_under_dir): Do not forget to
	fts_close the file_hierarchy that was previously fts_open-ed.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to the mainline.
---
 src/abg-tools-utils.cc | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc
index 0b72d670..97692610 100644
--- a/src/abg-tools-utils.cc
+++ b/src/abg-tools-utils.cc
@@ -2657,6 +2657,7 @@  find_file_under_dir(const string& root_dir,
       if (entry_of_file_with_name(entry, file_path_to_look_for, r))
 	{
 	  result = entry->fts_path;
+	  fts_close(file_hierarchy);
 	  return true;
 	}
       // Skip descendents of symbolic links.