free(filedata);
free(elfFileData); elfFileData = NULL;
bool elfRead(const char *name, int& siz, FILE *f){  fseek(f, 0, SEEK_END);  long size = ftell(f);  u8 *filedata = (u8 *)malloc(size);  fseek(f, 0, SEEK_SET);  fread(filedata, 1, size, f);  fclose(f);    ELFHeader *header = (ELFHeader *)filedata;    if(READ32LE(&header->magic) != 0x464C457F ||     READ16LE(&header->e_machine) != 40 ||     header->clazz != 1) {    systemMessage(0, "Not a valid ELF file %s", name);    free(filedata);    return false;  }  if(!elfReadProgram(header, filedata, siz, parseDebug)) {    free(filedata);    return false;  }  free(filedata);  //  systemMessage(0, "Done");    return true;}