aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-06 20:39:27 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-06 20:39:27 +0200
commit035e71578e98744acba2394bb03686d08f60d956 (patch)
tree276e9d1c68824c6e8f46c7e19fe90d7f1f338ce7
parent277081e0a4e04b1c39b3eadf4422ef36fded4705 (diff)
downloadbusybox-035e71578e98744acba2394bb03686d08f60d956.tar.gz
readprofile: do not close/free just before exiting
function old new delta readprofile_main 1784 1762 -22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--NOFORK_NOEXEC.lst6
-rw-r--r--util-linux/readprofile.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst
index ab58df50d..02e2ba956 100644
--- a/NOFORK_NOEXEC.lst
+++ b/NOFORK_NOEXEC.lst
@@ -48,7 +48,7 @@ ash - interactive, longterm
awk - noexec. runner
base64 - runner
basename - NOFORK
-beep
+beep - longterm: beep -r 999999999
blkdiscard - noexec. leaks: open+xioctl
blkid - noexec
blockdev - noexec. leaks fd
@@ -127,7 +127,7 @@ findfs - suid
flash_eraseall
flash_lock
flash_unlock
-flashcp
+flashcp - needs ^C. flash writing may be slow, better to free memory memory by execing
flock - spawner, changes state (file locks), let's play safe and not be noexec
fold - noexec. runner
free - nofork candidate(struct globals, needs to close /proc/meminfo fd)
@@ -278,7 +278,7 @@ raidautorun - noexec. very simple. leaks: open+xioctl
rdate - needs ^C (may talk to DNS servers, which may be down)
rdev - leaks: find_block_device -> readdir+xstrdup
readlink - NOFORK
-readprofile
+readprofile - reads /boot/System.map and /proc/profile, better to free more memory memory by execing?
realpath - NOFORK
reboot - rare
reformime - runner
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index b045657d8..394ece1dd 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -266,8 +266,10 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv)
printf("%6u %-40s %8.4f\n",
total, "total", total/(double)(fn_add-add0));
- fclose(map);
- free(buf);
+ if (ENABLE_FEATURE_CLEAN_UP) {
+ fclose(map);
+ free(buf);
+ }
return EXIT_SUCCESS;
}