]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
numfmt: 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/numfmt.c (main) [lint]: Omit unnecessary cleanup.
Use main_exit, not return.

src/numfmt.c

index 578aa558ac014054e8e397238764fa1625f92f67..fccb47480b397597fe2eecb1c293cd746d4f1344 100644 (file)
@@ -1627,19 +1627,10 @@ main (int argc, char **argv)
           valid_numbers &= process_line (line, newline);
         }
 
-      IF_LINT (free (line));
-
       if (ferror (stdin))
         error (0, errno, _("error reading input"));
     }
 
-#ifdef lint
-  free (padding_buffer);
-  free (format_str_prefix);
-  free (format_str_suffix);
-  reset_fields ();
-#endif
-
   if (debug && !valid_numbers)
     error (0, 0, _("failed to convert some of the input numbers"));
 
@@ -1648,5 +1639,5 @@ main (int argc, char **argv)
       && inval_style != inval_warn && inval_style != inval_ignore)
     exit_status = EXIT_CONVERSION_WARNINGS;
 
-  return exit_status;
+  main_exit (exit_status);
 }