mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-04 15:11:42 +03:00
mc_ungetlocalcopy does not free its second argument anymore.
This commit is contained in:
parent
8e36bb7fe0
commit
f17c1f291c
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user