commit | 6ef483eb876e788a18d22715ca72aafdd2ded542 | [log] [tgz] |
---|---|---|
author | Zijun Zhao <zijunzhao@google.com> | Fri Mar 31 23:59:02 2023 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Fri Mar 31 23:59:02 2023 +0000 |
tree | 08974f86f3d136dd8f15c055f28ac1589106031d | |
parent | 5ae243b7f9c6e7b359119b25d504ee552750a815 [diff] | |
parent | b8e4e469dc8e9f579d91f2784427a233ef9f5bb9 [diff] |
Merge "posix_spawn_file_actions_addopen(): crash early rather than late."
diff --git a/libc/bionic/spawn.cpp b/libc/bionic/spawn.cpp index 7e80ef6..5cf95d8 100644 --- a/libc/bionic/spawn.cpp +++ b/libc/bionic/spawn.cpp
@@ -340,7 +340,7 @@ if (action == nullptr) return errno; action->next = nullptr; - if (path != nullptr) { + if (what == kOpen) { action->path = strdup(path); if (action->path == nullptr) { free(action);