add: if(buf.cmdline) free((void*)*buf.cmdline); if(buf.environ) free((void*)*buf.environ);
context: static void simple_spew(void){  proc_t buf;  PROCTAB* ptp;  ptp = openproc(needs_for_format | needs_for_sort | PROC_FILLCMD);  if(!ptp) {    fprintf(stderr, "Error: can not access /proc.\n");    exit(1);  }  /* memset(&buf, '#', sizeof(proc_t)); */  /* use "ps_" prefix to catch library mismatch */  while(ps_readproc(ptp,&buf)){    fill_pcpu(&buf);    if(want_this_proc(&buf)) show_one_proc(&buf);    /* if(buf.cmdline) free(buf.cmdline); */   /* these crash */    /* if(buf.environ) free(buf.environ); */    /* memset(&buf, '#', sizeof(proc_t)); */  }  closeproc(ptp);}