btrfs-progs: init variables which are checked later in btrfs-property
The local variable @object etc. in btrfs-property get/set functions are to be checked whether to be NULL or not, but the @parse_args() don't guarantee to assign a value to it, so it is better to init it to NULL. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
515f8fa14a
commit
d3aa724646
|
@ -389,7 +389,7 @@ static void parse_args(int argc, char **argv,
|
|||
static int cmd_get(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
char *object;
|
||||
char *object = NULL;
|
||||
char *name = NULL;
|
||||
int types = 0;
|
||||
|
||||
|
@ -413,9 +413,9 @@ static int cmd_get(int argc, char **argv)
|
|||
static int cmd_set(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
char *object;
|
||||
char *name;
|
||||
char *value;
|
||||
char *object = NULL;
|
||||
char *name = NULL;
|
||||
char *value = NULL;
|
||||
int types = 0;
|
||||
|
||||
if (check_argc_min(argc, 4) || check_argc_max(argc, 6))
|
||||
|
|
Loading…
Reference in New Issue