Print this page
6659 nvlist_free(NULL) is a no-op

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zpool/zpool_main.c
          +++ new/usr/src/cmd/zpool/zpool_main.c
↓ open down ↓ 3233 lines elided ↑ open up ↑
3234 3234          flags.import = B_FALSE;
3235 3235  
3236 3236          /* check options */
3237 3237          while ((c = getopt(argc, argv, ":R:no:")) != -1) {
3238 3238                  switch (c) {
3239 3239                  case 'R':
3240 3240                          flags.import = B_TRUE;
3241 3241                          if (add_prop_list(
3242 3242                              zpool_prop_to_name(ZPOOL_PROP_ALTROOT), optarg,
3243 3243                              &props, B_TRUE) != 0) {
3244      -                                if (props)
3245      -                                        nvlist_free(props);
     3244 +                                nvlist_free(props);
3246 3245                                  usage(B_FALSE);
3247 3246                          }
3248 3247                          break;
3249 3248                  case 'n':
3250 3249                          flags.dryrun = B_TRUE;
3251 3250                          break;
3252 3251                  case 'o':
3253 3252                          if ((propval = strchr(optarg, '=')) != NULL) {
3254 3253                                  *propval = '\0';
3255 3254                                  propval++;
3256 3255                                  if (add_prop_list(optarg, propval,
3257 3256                                      &props, B_TRUE) != 0) {
3258      -                                        if (props)
3259      -                                                nvlist_free(props);
     3257 +                                        nvlist_free(props);
3260 3258                                          usage(B_FALSE);
3261 3259                                  }
3262 3260                          } else {
3263 3261                                  mntopts = optarg;
3264 3262                          }
3265 3263                          break;
3266 3264                  case ':':
3267 3265                          (void) fprintf(stderr, gettext("missing argument for "
3268 3266                              "'%c' option\n"), optopt);
3269 3267                          usage(B_FALSE);
↓ open down ↓ 2051 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX