Fixed memory leakage

This commit is contained in:
fabio.olimpieri 2014-03-22 18:57:54 +00:00
parent c224d54e1a
commit d7783c1a56

View File

@ -341,15 +341,15 @@ void create_browser_tap (FILE * fichero) {
block_number=0; block_number=0;
do { do {
byte_position=ftell(fichero); byte_position=ftell(fichero);
browser_list[block_number]=(struct browser *)malloc(sizeof(struct browser));
browser_list[block_number]->position=byte_position;
strcpy(browser_list[block_number]->info, " ");
strcpy(browser_list[block_number]->block_type,"Standard Speed Data");
retval=fread (value, 1, 2, fichero); // read length of current block retval=fread (value, 1, 2, fichero); // read length of current block
if (retval!=2) {retorno=1;break;} if (retval!=2) {retorno=1;break;}
longitud = ((unsigned int) value[0]) + 256 * ((unsigned int) value[1]); longitud = ((unsigned int) value[0]) + 256 * ((unsigned int) value[1]);
retval=fread (&flag_byte, 1, 1, fichero); retval=fread (&flag_byte, 1, 1, fichero);
if (retval!=1) {retorno=1;break;} if (retval!=1) {retorno=1;break;}
browser_list[block_number]=(struct browser *)malloc(sizeof(struct browser));
browser_list[block_number]->position=byte_position;
strcpy(browser_list[block_number]->info, " ");
strcpy(browser_list[block_number]->block_type,"Standard Speed Data");
printf("TAP browser: flag byte %X en %ld\n",flag_byte, ftell(fichero)); printf("TAP browser: flag byte %X en %ld\n",flag_byte, ftell(fichero));
switch(flag_byte) switch(flag_byte)
{ {