Added missing iso_filesystem_ref() for cloned node from local filesystem.

This commit is contained in:
Thomas Schmitt 2011-02-01 22:16:05 +01:00
parent 1082e628d1
commit 38483d894e
2 changed files with 5 additions and 3 deletions

View File

@ -1081,10 +1081,8 @@ int ifs_clone_src(IsoFileSource *old_source,
goto no_mem; goto no_mem;
new_data->fs = old_data->fs; new_data->fs = old_data->fs;
iso_filesystem_ref(new_data->fs);
new_data->parent = old_data->parent; new_data->parent = old_data->parent;
iso_file_source_ref(new_data->parent);
memcpy(&(new_data->info), &(old_data->info), sizeof(struct stat)); memcpy(&(new_data->info), &(old_data->info), sizeof(struct stat));
new_data->name = new_name; new_data->name = new_name;
@ -1106,6 +1104,8 @@ int ifs_clone_src(IsoFileSource *old_source,
src->refcount = 1; src->refcount = 1;
src->data = new_data; src->data = new_data;
*new_source = src; *new_source = src;
iso_file_source_ref(new_data->parent);
iso_filesystem_ref(new_data->fs);
return ISO_SUCCESS; return ISO_SUCCESS;
no_mem:; no_mem:;
if (src != NULL) if (src != NULL)

View File

@ -561,12 +561,14 @@ int lfs_clone_src(IsoFileSource *old_source,
new_data->info.fd = -1; /* the value does not matter with (openned == 0) */ new_data->info.fd = -1; /* the value does not matter with (openned == 0) */
new_data->name = new_name; new_data->name = new_name;
new_data->parent = old_data->parent; new_data->parent = old_data->parent;
iso_file_source_ref(new_data->parent);
src->class = old_source->class; src->class = old_source->class;
src->refcount = 1; src->refcount = 1;
src->data = new_data; src->data = new_data;
*new_source = src; *new_source = src;
iso_file_source_ref(new_data->parent);
iso_filesystem_ref(lfs);
return ISO_SUCCESS; return ISO_SUCCESS;
no_mem:; no_mem:;
if (src != NULL) if (src != NULL)