Skip to content
Snippets Groups Projects
Commit 4c083e99 authored by Michael Tüxen's avatar Michael Tüxen
Browse files

Fix CID 187210.

parent 2ffbfa4e
No related branches found
No related tags found
No related merge requests found
...@@ -4670,16 +4670,24 @@ static int syscall_open(struct state *state, struct syscall_spec *syscall, ...@@ -4670,16 +4670,24 @@ static int syscall_open(struct state *state, struct syscall_spec *syscall,
result = open(name, flags); result = open(name, flags);
if (end_syscall(state, syscall, CHECK_FD, result, error)) if (end_syscall(state, syscall, CHECK_FD, result, error)) {
if (result >= 0) {
close(result);
}
return STATUS_ERR; return STATUS_ERR;
}
if (result >= 0) { if (result >= 0) {
live_fd = result; live_fd = result;
if (get_s32(syscall->result, &script_fd, error)) if (get_s32(syscall->result, &script_fd, error)) {
close(live_fd);
return STATUS_ERR; return STATUS_ERR;
}
if (!insert_new_socket(state, 0, 0, if (!insert_new_socket(state, 0, 0,
script_fd, live_fd, error)) script_fd, live_fd, error)) {
close(live_fd);
return STATUS_ERR; return STATUS_ERR;
}
} }
return STATUS_OK; return STATUS_OK;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment