Skip to content

Commit fd856d0

Browse files
committed
btrfs-progs: tune: reset fs_info->new_chunk_tree_uuid at the end
The CodeQL scan points out a local variable is stored in a non-local memory, in this case it's the uuid buffer for new chunk. There are error paths leading to the label 'out' that do not reset it. This is not a problem as this does not leak outside, but let's reset it in all cases. Signed-off-by: David Sterba <[email protected]>
1 parent 4a99311 commit fd856d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tune/change-uuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ int change_uuid(struct btrfs_fs_info *fs_info, const char *new_fsid_str)
300300
/* Now fsid change is done */
301301
pr_verbose(LOG_DEFAULT, "Clear superblock flag CHANGING_FSID\n");
302302
ret = change_fsid_done(fs_info);
303-
fs_info->new_chunk_tree_uuid = NULL;
304303
pr_verbose(LOG_DEFAULT, "Fsid change finished\n");
305304
out:
305+
fs_info->new_chunk_tree_uuid = NULL;
306306
return ret;
307307
}
308308

0 commit comments

Comments
 (0)