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

@@ -285,15 +285,12 @@
         err += nvlist_add_nvlist(dtcr, FM_FMRI_SW_OBJ, obj);
         err += nvlist_add_nvlist(dtcr, FM_FMRI_SW_SITE, site);
         err += nvlist_add_nvlist(dtcr, FM_FMRI_SW_CTXT, ctxt);
 
 done:
-        if (obj != NULL)
                 nvlist_free(obj);
-        if (site != NULL)
                 nvlist_free(site);
-        if (ctxt != NULL)
                 nvlist_free(ctxt);
 
         if (err == 0) {
                 return (dtcr);
         } else {

@@ -554,11 +551,10 @@
         (void) pthread_mutex_unlock(&fmevt_lock);
 
         if (ruleset)
                 free(ruleset);
 
-        if (rawattr)
                 nvlist_free(rawattr);
 
         return (0);     /* in all cases consider the event delivered */
 }