summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/install.cpp b/install.cpp
index d8372e276..576e7741e 100644
--- a/install.cpp
+++ b/install.cpp
@@ -373,6 +373,14 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache,
}
pid_t pid = fork();
+
+ if (pid == -1) {
+ close(pipefd[0]);
+ close(pipefd[1]);
+ LOGE("Failed to fork update binary: %s\n", strerror(errno));
+ return INSTALL_ERROR;
+ }
+
if (pid == 0) {
umask(022);
close(pipefd[0]);