瀏覽代碼

tar: omit unnecessary freeing

* src/tar.c (main): Omit unnecessary freeing.
Paul Eggert 1 年之前
父節點
當前提交
90cceec4bb
共有 1 個文件被更改,包括 8 次插入5 次删除
  1. 8 5
      src/tar.c

+ 8 - 5
src/tar.c

@@ -2852,11 +2852,14 @@ main (int argc, char **argv)
   if (volno_file_option)
     closeout_volume_number ();
 
-  /* Dispose of allocated memory, and return.  */
-
-  free (archive_name_array);
-  xattrs_clear_setup ();
-  name_term ();
+  /* There is little point to freeing, as we are about to exit,
+     and freeing is more likely to cause than cure trouble.  */
+  if (false)
+    {
+      free (archive_name_array);
+      xattrs_clear_setup ();
+      name_term ();
+    }
 
   if (exit_status == TAREXIT_FAILURE)
     error (0, 0, _("Exiting with failure status due to previous errors"));