]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(movefile): Don't free new_dest.
authorJim Meyering <jim@meyering.net>
Mon, 30 Nov 1998 02:01:18 +0000 (02:01 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 30 Nov 1998 02:01:18 +0000 (02:01 +0000)
Bob McCracken reported that mv couldn't handle certain combinations
of hard linked source files.

src/mv.c

index 111851f05e180825891c2ab947b8857f99ff2640..cd03b5ab02bc7b0e477a1c42f1fed1448d4e87f5 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -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
     {