commit | a511a3c4071d5b119605e9edcddc04a715581955 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Mon Nov 21 19:24:08 2016 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Mon Nov 21 19:24:09 2016 +0000 |
tree | f89fd18f4a0669875599ea8647a29570a3bf7a3e | |
parent | 340a2d364f4909c7f87afbd1d1aab1aa0abf66d4 [diff] | |
parent | 48cf770471ef53fbf0a1837196220862a0bdb18d [diff] |
Merge "applypatch: Release FD when explicitly calling close."
diff --git a/install.cpp b/install.cpp index 98f1e3f..f124a26 100644 --- a/install.cpp +++ b/install.cpp
@@ -373,6 +373,14 @@ } pid_t pid = fork(); + + if (pid == -1) { + close(pipefd[0]); + close(pipefd[1]); + PLOG(ERROR) << "Failed to fork update binary"; + return INSTALL_ERROR; + } + if (pid == 0) { umask(022); close(pipefd[0]);