mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-27 15:30:44 +00:00
btrfs-progs: initialize all return parameters in btrfs_test_for_multiple_profiles()
Reported by 'gcc -fanalyzer': common/utils.c:1203:9: warning: use of uninitialized value ‘data’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] There are several return parameters passed to btrfs_get_string_for_multiple_profiles(), in case it fails early no values are assigned so the free() would be called on some stack initialization value. Initialize all the pointers. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
12bdb72d50
commit
c17d3b2969
@ -1196,7 +1196,11 @@ out:
|
|||||||
*/
|
*/
|
||||||
char *btrfs_test_for_multiple_profiles(int fd)
|
char *btrfs_test_for_multiple_profiles(int fd)
|
||||||
{
|
{
|
||||||
char *data, *metadata, *system, *mixed, *types;
|
char *data = NULL;
|
||||||
|
char *metadata = NULL;
|
||||||
|
char *system = NULL;
|
||||||
|
char *mixed = NULL;
|
||||||
|
char *types = NULL;
|
||||||
|
|
||||||
btrfs_get_string_for_multiple_profiles(fd, &data, &metadata, &mixed,
|
btrfs_get_string_for_multiple_profiles(fd, &data, &metadata, &mixed,
|
||||||
&system, &types);
|
&system, &types);
|
||||||
|
Loading…
Reference in New Issue
Block a user