]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
env: 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/env.c (unset_envvars): Remove IF_LINT code.
(main): Use main_exit, not return.

src/env.c

index abcd0a7897b0ea3b1223860801b3ccf82d82ac39..f7ef297e7f1c9b709bfa5442eaa7a3db68b23e42 100644 (file)
--- a/src/env.c
+++ b/src/env.c
@@ -184,11 +184,6 @@ unset_envvars (void)
         die (EXIT_CANCELED, errno, _("cannot unset %s"),
              quote (usvars[i]));
     }
-
-  IF_LINT (free (usvars));
-  IF_LINT (usvars = NULL);
-  IF_LINT (usvars_used = 0);
-  IF_LINT (usvars_alloc = 0);
 }
 
 /* Return a pointer to the end of a valid ${VARNAME} string, or NULL.
@@ -904,5 +899,5 @@ main (int argc, char **argv)
   if (exit_status == EXIT_ENOENT && strpbrk (argv[optind], C_ISSPACE_CHARS))
     error (0, 0, _("use -[v]S to pass options in shebang lines"));
 
-  return exit_status;
+  main_exit (exit_status);
 }