From 819b47aa357c33bf84919495795b36f8c1faa3ac Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 3 Aug 2017 03:29:32 +0200 Subject: new NOFORKs: clear, nproc, tty, uname, arch, unlink, which Signed-off-by: Denys Vlasenko --- debianutils/which.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'debianutils') diff --git a/debianutils/which.c b/debianutils/which.c index 3197ddac1..b31d61871 100644 --- a/debianutils/which.c +++ b/debianutils/which.c @@ -12,7 +12,7 @@ //config: which is used to find programs in your PATH and //config: print out their pathnames. -//applet:IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_WHICH(APPLET_NOFORK(which, which, BB_DIR_USR_BIN, BB_SUID_DROP, which)) //kbuild:lib-$(CONFIG_WHICH) += which.o @@ -56,6 +56,8 @@ int which_main(int argc UNUSED_PARAM, char **argv) char *p; path = tmp = xstrdup(env_path); +//NOFORK FIXME: nested xmallocs (one is inside find_executable()) +//can leak memory on failure while ((p = find_executable(*argv, &tmp)) != NULL) { missing = 0; puts(p); -- cgit v1.2.3