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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdiskmgt/common/entry.c
          +++ new/usr/src/lib/libdiskmgt/common/entry.c
↓ open down ↓ 708 lines elided ↑ open up ↑
 709  709                                  dm_free_name(str);
 710  710                                  nvlist_free(other_attrs);
 711  711                                  ret = 1;
 712  712                                  goto out;
 713  713                          }
 714  714                  }
 715  715                  nvlist_free(other_attrs);
 716  716          }
 717  717  
 718  718  out:
 719      -        if (media_attrs)
 720      -                nvlist_free(media_attrs);
 721      -        if (slice_attrs)
 722      -                nvlist_free(slice_attrs);
      719 +        nvlist_free(media_attrs);
      720 +        nvlist_free(slice_attrs);
 723  721  
 724  722          if (slices)
 725  723                  dm_free_descriptors(slices);
 726  724          if (media)
 727  725                  dm_free_descriptors(media);
 728  726          if (slice)
 729  727                  dm_free_descriptor(slice);
 730  728  
 731  729          return (ret);
 732  730  }
↓ open down ↓ 317 lines elided ↑ open up ↑
1050 1048                                  /*
1051 1049                                   * nothing found in use for this client
1052 1050                                   * of libdiskmgt. Default is 'not in use'.
1053 1051                                   */
1054 1052                                  break;
1055 1053                  }
1056 1054          }
1057 1055  out:
1058 1056          if (dname != NULL)
1059 1057                  free(dname);
1060      -        if (dev_stats != NULL)
1061      -                nvlist_free(dev_stats);
     1058 +        nvlist_free(dev_stats);
1062 1059  
1063 1060          return (found);
1064 1061  }
1065 1062  
1066 1063  void
1067 1064  dm_get_usage_string(char *what, char *how, char **usage_string)
1068 1065  {
1069 1066  
1070 1067  
1071 1068          if (usage_string == NULL || what == NULL) {
↓ open down ↓ 237 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX