cmd: Correctly initialize cmd_OptionAsString arguments
authorChas Williams (CONTRACTOR) <chas@cmf.nrl.navy.mil>
Wed, 20 Nov 2013 18:57:13 +0000 (13:57 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Wed, 20 Nov 2013 21:30:48 +0000 (13:30 -0800)
These are coming from the stack and as such they might not be NULL.

Change-Id: Ia5c6efd08574b4de05a11dceae47021b0160395b
Reviewed-on: http://gerrit.openafs.org/10475
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/volser/volmain.c

index 6c6ad53..f8bbd2f 100644 (file)
@@ -242,10 +242,10 @@ static int
 ParseArgs(int argc, char **argv) {
     int code;
     int optval;
-    char *optstring;
+    char *optstring = NULL;
     struct cmd_syndesc *opts;
-    char *sleepSpec;
-    char *sync_behavior;
+    char *sleepSpec = NULL;
+    char *sync_behavior = NULL;
 
     opts = cmd_CreateSyntax(NULL, NULL, NULL, NULL);
     cmd_AddParmAtOffset(opts, OPT_log, "-log", CMD_FLAG, CMD_OPTIONAL,