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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/fm/libfmevent/common/fmev_publish.c
          +++ new/usr/src/lib/fm/libfmevent/common/fmev_publish.c
↓ open down ↓ 426 lines elided ↑ open up ↑
 427  427           * const char *subclass Raw subclass
 428  428           * const char *vendor   Ruleset name
 429  429           * const char *pub_name Unused
 430  430           * nvlist_t *attr_list  Event attributes
 431  431           */
 432  432          rc = (sysevent_evc_publish(evc, class, subclass, ruleset, "",
 433  433              pub, EVCH_NOSLEEP) == 0) ? FMEV_SUCCESS : FMEVERR_TRANSPORT;
 434  434  
 435  435  done:
 436  436          /* Free a passed in nvlist iff success */
 437      -        if (nvl && rc == FMEV_SUCCESS)
      437 +        if (rc == FMEV_SUCCESS)
 438  438                  nvlist_free(nvl);
 439  439  
 440      -        if (tmpnvl)
 441      -                nvlist_free(tmpnvl);
      440 +        nvlist_free(tmpnvl);
 442  441  
 443  442          return (rc);
 444  443  }
 445  444  
 446  445  fmev_err_t
 447  446  _i_fmev_publish_nvl(
 448  447      const char *file, const char *func, int64_t line,
 449  448      const char *ruleset, const char *class, const char *subclass,
 450  449      fmev_pri_t pri, nvlist_t *attr)
 451  450  {
↓ open down ↓ 85 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX