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


1753                 (void) scf_set_error(SCF_ERROR_NO_MEMORY);
1754                 goto cleanup;
1755         }
1756 
1757         if (_scf_notify_get_params(pg, params) != SCF_SUCCESS)
1758                 goto cleanup;
1759 
1760         if (getsource && get_pg_source(pg, params) != SCF_SUCCESS)
1761                 goto cleanup;
1762 
1763         if (nvlist_add_nvlist_array(nvl, SCF_NOTIFY_PARAMS, &params, 1) != 0 ||
1764             nvlist_add_uint32(nvl, SCF_NOTIFY_NAME_VERSION,
1765             SCF_NOTIFY_PARAMS_VERSION) != 0) {
1766                 (void) scf_set_error(SCF_ERROR_NO_MEMORY);
1767                 goto cleanup;
1768         }
1769 
1770         r = SCF_SUCCESS;
1771 
1772 cleanup:
1773         if (params)
1774                 nvlist_free(params);
1775         scf_pg_destroy(pg);
1776         scf_instance_destroy(i);
1777         scf_handle_destroy(h);
1778         free(pgname);
1779 
1780         return (r);
1781 }
1782 
1783 /*
1784  * Retrieve the notification parameters for the Event described in the
1785  * input nvlist_t nvl.
1786  * The function will allocate an nvlist_t to store the notification
1787  * parameters. The notification parameters in the output nvlist will have
1788  * the following format:
1789  *
1790  *        version (uint32_t)
1791  *        SCF_NOTIFY_PARAMS (array of embedded nvlists)
1792  *             (start of notify-params[0])
1793  *                  tset (int32_t)




1753                 (void) scf_set_error(SCF_ERROR_NO_MEMORY);
1754                 goto cleanup;
1755         }
1756 
1757         if (_scf_notify_get_params(pg, params) != SCF_SUCCESS)
1758                 goto cleanup;
1759 
1760         if (getsource && get_pg_source(pg, params) != SCF_SUCCESS)
1761                 goto cleanup;
1762 
1763         if (nvlist_add_nvlist_array(nvl, SCF_NOTIFY_PARAMS, &params, 1) != 0 ||
1764             nvlist_add_uint32(nvl, SCF_NOTIFY_NAME_VERSION,
1765             SCF_NOTIFY_PARAMS_VERSION) != 0) {
1766                 (void) scf_set_error(SCF_ERROR_NO_MEMORY);
1767                 goto cleanup;
1768         }
1769 
1770         r = SCF_SUCCESS;
1771 
1772 cleanup:

1773         nvlist_free(params);
1774         scf_pg_destroy(pg);
1775         scf_instance_destroy(i);
1776         scf_handle_destroy(h);
1777         free(pgname);
1778 
1779         return (r);
1780 }
1781 
1782 /*
1783  * Retrieve the notification parameters for the Event described in the
1784  * input nvlist_t nvl.
1785  * The function will allocate an nvlist_t to store the notification
1786  * parameters. The notification parameters in the output nvlist will have
1787  * the following format:
1788  *
1789  *        version (uint32_t)
1790  *        SCF_NOTIFY_PARAMS (array of embedded nvlists)
1791  *             (start of notify-params[0])
1792  *                  tset (int32_t)