Whamcloud - gitweb
b=21600 Fix unitialized pointer
authorBrian J. Murrell <brian@sun.com>
Mon, 14 Dec 2009 21:03:16 +0000 (16:03 -0500)
committerRobert Read <rread@vpn-129-150-244-142.sfbay.sun.com>
Mon, 14 Dec 2009 21:18:55 +0000 (13:18 -0800)
gcc warns that ctx may be used prior to assignment, so initialize it
at declaration

i=rread

lustre/utils/mkfs_lustre.c

index 59e68cc..a4fb608 100644 (file)
@@ -1408,7 +1408,7 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop,
  */
 static int in_mntlist(char *opt, char *mntlist)
 {
  */
 static int in_mntlist(char *opt, char *mntlist)
 {
-        char *ml, *mlp, *item, *ctx;
+        char *ml, *mlp, *item, *ctx = NULL;
 
         if (!(ml = strdup(mntlist))) {
                 fprintf(stderr, "%s: out of memory\n", progname);
 
         if (!(ml = strdup(mntlist))) {
                 fprintf(stderr, "%s: out of memory\n", progname);