Merge "posix_spawn_file_actions_addopen(): crash early rather than late." am: 6ef483eb87

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2515747

Change-Id: If5064907ea99bce42f2e73c50c5292cb61945031
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Zijun Zhao 2023-04-01 00:41:00 +00:00 committed by Automerger Merge Worker
commit f658816d6b

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);