env: simplify -fsanitize=leak pacification

* src/env.c (unset_envvars): Remove IF_LINT code.
(main): Use main_exit, not return.
This commit is contained in:
Paul Eggert
2022-01-31 08:42:07 -08:00
parent 04d735ea96
commit ed93b50eea

View File

@@ -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);
}