]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- fixed memory leak 1043/head
authorArvin Schnell <aschnell@suse.de>
Tue, 5 Aug 2025 09:37:26 +0000 (11:37 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 5 Aug 2025 09:37:26 +0000 (11:37 +0200)
snapper/Btrfs.cc

index 355305cbe509f8e23b786ec418f856d307ed97af..e10053dc40e7b7965ede835c655cfc40947bb06d 100644 (file)
@@ -767,12 +767,15 @@ namespace snapper
     bool
     StreamProcessor::get_root_id(const string& path, u64* root_id)
     {
-       struct subvol_info* si;
-       si = subvol_uuid_search(&sus, 0, NULL, 0, path.c_str(), subvol_search_by_path);
+       struct subvol_info* si = subvol_uuid_search(&sus, 0, NULL, 0, path.c_str(), subvol_search_by_path);
        if (!si)
            return false;
 
        *root_id = si->root_id;
+
+       free(si->path);
+       free(si);
+
        return true;
     }