]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Omit unnecessary freeing
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 17 Jun 2023 07:37:08 +0000 (00:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 17 Jun 2023 07:37:43 +0000 (00:37 -0700)
* src/extract.c (apply_delayed_link): Don’t bother to
free memory, as we’re about to exit.

src/extract.c

index bc2abbfeb86384d11293fb12d400391cbe4b9df3..3bf407bc004773f8b89f92baf7111f7cdde4acde 100644 (file)
@@ -1927,15 +1927,20 @@ apply_delayed_link (struct delayed_link *ds)
        }
     }
 
-  for (sources = ds->sources; sources; )
+  /* There is little point to freeing, as we are about to exit,
+     and freeing is more likely to cause than cure trouble.  */
+  if (false)
     {
-      struct string_list *next = sources->next;
-      free (sources);
-      sources = next;
-    }
+      for (sources = ds->sources; sources; )
+       {
+         struct string_list *next = sources->next;
+         free (sources);
+         sources = next;
+       }
 
-  xattr_map_free (&ds->xattr_map);
-  free (ds->cntx_name);
+      xattr_map_free (&ds->xattr_map);
+      free (ds->cntx_name);
+    }
 }
 
 /* Extract the links whose final extraction were delayed.  */