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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/fm/modules/common/sw-diag-response/subsidiary/panic/panic_diag.c
          +++ new/usr/src/cmd/fm/modules/common/sw-diag-response/subsidiary/panic/panic_diag.c
↓ open down ↓ 174 lines elided ↑ open up ↑
 175  175          nvlist_t *sw_obj;
 176  176          int err = 0;
 177  177  
 178  178          fmri = fmd_nvl_alloc(hdl, FMD_SLEEP);
 179  179          err |= nvlist_add_uint8(fmri, FM_VERSION, FM_SW_SCHEME_VERSION);
 180  180          err |= nvlist_add_string(fmri, FM_FMRI_SCHEME, FM_FMRI_SCHEME_SW);
 181  181  
 182  182          sw_obj = fmd_nvl_alloc(hdl, FMD_SLEEP);
 183  183          err |= nvlist_add_string(sw_obj, FM_FMRI_SW_OBJ_PATH, object);
 184  184          err |= nvlist_add_nvlist(fmri, FM_FMRI_SW_OBJ, sw_obj);
 185      -        if (sw_obj)
 186      -                nvlist_free(sw_obj);
      185 +        nvlist_free(sw_obj);
 187  186          if (!err)
 188  187                  return (fmri);
 189  188          else
 190  189                  return (0);
 191  190  }
 192  191  
 193  192  static const char *dumpfiles[2] = { "unix.%lld", "vmcore.%lld" };
 194  193  static const char *dumpfiles_comp[2] = { "vmdump.%lld", NULL};
 195  194  
 196  195  static void
↓ open down ↓ 395 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX