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>
This commit is contained in:
Zijun Zhao 2023-04-01 01:23:31 +00:00 committed by Automerger Merge Worker
commit d7a95555c9

View file

@ -340,7 +340,7 @@ static int posix_spawn_add_file_action(posix_spawn_file_actions_t* actions,
if (action == nullptr) return errno;
action->next = nullptr;
if (path != nullptr) {
if (what == kOpen) {
action->path = strdup(path);
if (action->path == nullptr) {
free(action);