procstat_t *ptr;
int status;
- new = (procstat_t *) malloc (sizeof (procstat_t));
+ new = malloc (sizeof (*new));
if (new == NULL)
{
ERROR ("processes plugin: ps_list_register: malloc failed.");
if (regexp != NULL)
{
DEBUG ("ProcessMatch: adding \"%s\" as criteria to process %s.", regexp, name);
- new->re = (regex_t *) malloc (sizeof (regex_t));
+ new->re = malloc (sizeof (*new->re));
if (new->re == NULL)
{
ERROR ("processes plugin: ps_list_register: malloc failed.");
{
procstat_entry_t *new;
- new = (procstat_entry_t *) malloc (sizeof (procstat_entry_t));
+ new = malloc (sizeof (*new));
if (new == NULL)
return;
memset (new, 0, sizeof (procstat_entry_t));
* are retrieved from kstat (module cpu, name sys, class misc, stat nthreads).
* The result is the sum for all the threads created on each cpu
*/
-static int read_fork_rate()
+static int read_fork_rate (void)
{
extern kstat_ctl_t *kc;
kstat_t *ksp_chain = NULL;