]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
shuf: simplify -fsanitize=leak pacification
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 31 Jan 2022 16:42:07 +0000 (08:42 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 31 Jan 2022 20:07:39 +0000 (12:07 -0800)
* src/shuf.c (main) [lint]: Omit unnecessary cleanup.
Use main_exit, not return.

src/shuf.c

index 7f696d6b09de53b4a703f1adeef1be83daf36e37..68ca609ebbc6f8c0c1c749af75f5801fe77d48c0 100644 (file)
@@ -595,22 +595,5 @@ main (int argc, char **argv)
   if (i != 0)
     die (EXIT_FAILURE, errno, _("write error"));
 
-#ifdef lint
-  free (permutation);
-  randint_all_free (randint_source);
-  if (input_lines)
-    {
-      free (input_lines[0]);
-      free (input_lines);
-    }
-  if (reservoir)
-    {
-      size_t j;
-      for (j = 0; j < n_lines; ++j)
-        freebuffer (&reservoir[j]);
-      free (reservoir);
-    }
-#endif
-
-  return EXIT_SUCCESS;
+  main_exit (EXIT_SUCCESS);
 }