diff options
author | Rickard Green <[email protected]> | 2018-10-12 17:59:18 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2018-10-12 17:59:18 +0200 |
commit | 8e65d31faab67b9844bbbaaa6245b2da2dd97b76 (patch) | |
tree | fec253c9db3c1d24b77f3f4933b8361ef740266b /erts/emulator/nifs/common | |
parent | e620c8c507c33ebca6216d71a8de73bce2722ac2 (diff) | |
parent | 13baa4384c4c9c49e6d540bc8ae6b8946f2454ed (diff) | |
download | otp-8e65d31faab67b9844bbbaaa6245b2da2dd97b76.tar.gz otp-8e65d31faab67b9844bbbaaa6245b2da2dd97b76.tar.bz2 otp-8e65d31faab67b9844bbbaaa6245b2da2dd97b76.zip |
Merge branch 'maint'
* maint:
Updated OTP version
Prepare release
erts: Fix UNC path handling on Windows
erts: Fix a compiler warning
eldap: Fix race at socket close
Fix bug for sockopt pktoptions on BSD
erts: Fix memory leak on file read errors
Diffstat (limited to 'erts/emulator/nifs/common')
-rw-r--r-- | erts/emulator/nifs/common/prim_file_nif.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/nifs/common/prim_file_nif.c b/erts/emulator/nifs/common/prim_file_nif.c index 9b98ac3f9a..009761a7f8 100644 --- a/erts/emulator/nifs/common/prim_file_nif.c +++ b/erts/emulator/nifs/common/prim_file_nif.c @@ -514,6 +514,7 @@ static ERL_NIF_TERM read_nif_impl(efile_data_t *d, ErlNifEnv *env, int argc, con ASSERT(bytes_read <= block_size); if(bytes_read < 0) { + enif_release_binary(&result); return posix_error_to_tuple(env, d->posix_errno); } else if(bytes_read == 0) { enif_release_binary(&result); @@ -577,6 +578,7 @@ static ERL_NIF_TERM pread_nif_impl(efile_data_t *d, ErlNifEnv *env, int argc, co bytes_read = efile_preadv(d, offset, read_vec, 1); if(bytes_read < 0) { + enif_release_binary(&result); return posix_error_to_tuple(env, d->posix_errno); } else if(bytes_read == 0) { enif_release_binary(&result); @@ -804,6 +806,7 @@ static ERL_NIF_TERM ipread_s32bu_p32bu_nif_impl(efile_data_t *d, ErlNifEnv *env, bytes_read = efile_preadv(d, payload_offset, read_vec, 1); if(bytes_read < 0) { + enif_release_binary(&payload); return posix_error_to_tuple(env, d->posix_errno); } else if(bytes_read == 0) { enif_release_binary(&payload); |