Gui Hecheng
2014-Jul-31 03:23 UTC
[PATCH 1/3] 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>
---
cmds-property.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cmds-property.c b/cmds-property.c
index 9c4eb92..90c7603 100644
--- a/cmds-property.c
+++ b/cmds-property.c
@@ -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))
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html