rem: delete list;
context: int get_mmc_profile (int fd){  Scsi_Command cmd(fd);  int retval = -1;  unsigned char page[20];  unsigned char *sense=cmd.sense();  int i;  cmd[0]=0x46;  cmd[1]=2;  cmd[8]=8;  cmd[9]=0;  if (cmd.transport(READ,page,8))  {    /* if (sense[0]==0) perror("Unable to ioctl");	  else             fprintf(stderr,"GET CONFIGURATION failed with "			  "SK=%xh/ASC=%02xh/ASCQ=%02xh\n",			  sense[2]&0xF,sense[12],sense[13]); */	  goto bail;  }  // See if it's 2 gen drive by checking if DVD+R profile is an option  {    int len=4+(page[0]<<24|page[1]<<16|page[2]<<8|page[3]);    if (len>264)    {      /* fprintf (stderr,"insane profile list length [%d].\n",len); */      goto bail;    }    unsigned char *list=new unsigned char[len];    cmd[0]=0x46;    cmd[1]=2;    cmd[7]=len>>8;    cmd[8]=len;    cmd[9]=0;    if (cmd.transport(READ,list,len))    {      /* fprintf(stderr,"GET CONFIGURATION failed with "		      "SK=%xh/ASC=%02xh/ASCQ=%02xh\n",		      sense[2]&0xF,sense[12],sense[13]); */      goto bail;    }    delete list;  }  return page[6]<<8|page[7];bail:  return retval;}