commit | d7a95555c9bb650776c325dfc3ed05fe99674f20 | [log] [tgz] |
---|---|---|
author | Zijun Zhao <zijunzhao@google.com> | Sat Apr 01 01:23:31 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Apr 01 01:23:31 2023 +0000 |
tree | 08974f86f3d136dd8f15c055f28ac1589106031d | |
parent | 04cf200c8967cbb1c98d79705f5b43da3e23b2ee [diff] | |
parent | f658816d6b64b3bca53fb0f843f7220dafeaf326 [diff] |
Merge "posix_spawn_file_actions_addopen(): crash early rather than late." am: 6ef483eb87 am: f658816d6b Original change: https://android-review.googlesource.com/c/platform/bionic/+/2515747 Change-Id: Id3c4156cb875d0e004d7110652e363be9c60b35b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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);