1
0
mirror of https://git.savannah.gnu.org/git/coreutils.git synced 2026-11-11 12:02:02 +03:00

(movefile): Don't free new_dest.

Bob McCracken reported that mv couldn't handle certain combinations
of hard linked source files.
This commit is contained in:
Jim Meyering
1998-11-30 02:01:18 +00:00
parent b9c6c84a8c
commit 75d5ed8b58

View File

@@ -308,7 +308,9 @@ movefile (char *source, char *dest, int dest_is_dir, const struct cp_options *x)
if (new_dest == NULL)
error (1, 0, _("virtual memory exhausted"));
fail = do_move (source, new_dest, x);
free (new_dest);
/* Do not free new_dest. It may have been squirelled away by
the remember_copied function. */
}
else
{