Fix bug related with reading of images with reallocated dirs.

This commit is contained in:
Vreixo Formoso 2008-01-03 17:16:27 +01:00
parent b8e44a936a
commit 2f535abe85
1 changed files with 4 additions and 4 deletions

View File

@ -331,7 +331,7 @@ int read_dir(ImageFileSourceData *data)
} }
/* add to the child list */ /* add to the child list */
{ if (ret != 0) {
struct child_list *node; struct child_list *node;
node = malloc(sizeof(struct child_list)); node = malloc(sizeof(struct child_list));
if (node == NULL) { if (node == NULL) {
@ -365,7 +365,7 @@ int ifs_open(IsoFileSource *src)
return ISO_NULL_POINTER; return ISO_NULL_POINTER;
} }
data = (ImageFileSourceData*)src->data; data = (ImageFileSourceData*)src->data;
if (data->opened) { if (data->opened) {
return ISO_FILE_ALREADY_OPENNED; return ISO_FILE_ALREADY_OPENNED;
} }
@ -558,7 +558,7 @@ int ifs_readdir(IsoFileSource *src, IsoFileSource **child)
/* free the first element of the list */ /* free the first element of the list */
data->data.content = children->next; data->data.content = children->next;
free(children); free(children);
return ISO_SUCCESS; return ISO_SUCCESS;
} }
@ -925,7 +925,7 @@ int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
ret = iso_file_source_new_ifs(fs, parent, (struct ecma119_dir_record*) ret = iso_file_source_new_ifs(fs, parent, (struct ecma119_dir_record*)
buffer, src); buffer, src);
if (ret < 0) { if (ret <= 0) {
return ret; return ret;
} }