mc_ungetlocalcopy does not free its second argument anymore.

This commit is contained in:
Roland Illig 2004-08-16 15:18:17 +00:00
parent 8e36bb7fe0
commit f17c1f291c
4 changed files with 9 additions and 4 deletions

View File

@ -356,5 +356,6 @@ execute_with_vfs_arg (const char *command, const char *filename)
do_execute (command, localcopy, EXECUTE_INTERNAL);
mc_stat (localcopy, &st);
mc_ungetlocalcopy (fn, localcopy, mtime != st.st_mtime);
g_free (localcopy);
g_free (fn);
}

View File

@ -123,6 +123,7 @@ exec_extension (const char *filename, const char *data, int *move_dir,
unlink (file_name);
if (localcopy) {
mc_ungetlocalcopy (filename, localcopy, 0);
g_free (localcopy);
}
g_free (file_name);
return;
@ -282,6 +283,7 @@ exec_extension (const char *filename, const char *data, int *move_dir,
mc_stat (localcopy, &mystat);
mc_ungetlocalcopy (filename, localcopy,
localmtime != mystat.st_mtime);
g_free (localcopy);
}
}
@ -355,6 +357,7 @@ regex_check_type (char *filename, char *ptr, int *have_type)
get_file_type_local (localfile, content_string,
sizeof (content_string));
mc_ungetlocalcopy (filename, localfile, 0);
g_free (localfile);
if (got_data > 0) {
char *pp;

View File

@ -204,7 +204,7 @@ static void extfs_free_archive (struct archive *archive)
mc_stat (archive->local_name, &my);
mc_ungetlocalcopy (archive->name, archive->local_name,
archive->local_stat.st_mtime != my.st_mtime);
/* mc_ungetlocalcopy() frees local_name for us */
g_free(archive->local_name);
}
if (archive->name)
g_free (archive->name);
@ -248,8 +248,10 @@ extfs_open_archive (int fstype, const char *name, struct archive **pparc)
g_free (cmd);
if (result == NULL) {
close_error_pipe (1, NULL);
if (local_name)
if (local_name) {
mc_ungetlocalcopy (name, local_name, 0);
g_free(local_name);
}
return NULL;
}

View File

@ -887,7 +887,7 @@ mc_def_ungetlocalcopy (struct vfs_class *vfs, const char *filename,
}
int
mc_ungetlocalcopy (const char *pathname, char *local, int has_changed)
mc_ungetlocalcopy (const char *pathname, const char *local, int has_changed)
{
int return_value = 0;
char *path = vfs_canon (pathname);
@ -897,7 +897,6 @@ mc_ungetlocalcopy (const char *pathname, char *local, int has_changed)
(*vfs->ungetlocalcopy)(vfs, path, local, has_changed) :
mc_def_ungetlocalcopy (vfs, path, local, has_changed);
g_free (path);
g_free (local);
return return_value;
}