Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: sandbox/linux/suid/process_util_linux.c

Issue 2419383008: Close the file handle before exiting the function (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/suid/process_util_linux.c
diff --git a/sandbox/linux/suid/process_util_linux.c b/sandbox/linux/suid/process_util_linux.c
index 40949bd6ac50662452dcb2842514a47392d63adf..d28d5766c348590a72d602618919fa8fb65a15e8 100644
--- a/sandbox/linux/suid/process_util_linux.c
+++ b/sandbox/linux/suid/process_util_linux.c
@@ -59,6 +59,7 @@ bool AdjustOOMScore(pid_t process, int score) {
fd = openat(dirfd, "oom_adj", O_WRONLY);
if (fd < 0) {
// Nope, that doesn't work either.
+ close(dirfd);
return false;
} else {
// If we're using the old oom_adj file, the allowed range is now
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698