mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
libexpr-c: Fix mismatched new/delete
This leads to ASAN errors: ==1137785==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x523000001d00 in thread T0: object passed to delete has wrong type: size of the allocated type: 5968 bytes; size of the deallocated type: 5968 bytes. alignment of the allocated type: 8 bytes; alignment of the deallocated type: default-aligned.
This commit is contained in:
parent
b4fcb64276
commit
309d55807c
1 changed files with 2 additions and 2 deletions
|
|
@ -137,7 +137,7 @@ nix_eval_state_builder * nix_eval_state_builder_new(nix_c_context * context, Sto
|
|||
|
||||
void nix_eval_state_builder_free(nix_eval_state_builder * builder)
|
||||
{
|
||||
delete builder;
|
||||
operator delete(builder, static_cast<std::align_val_t>(alignof(nix_eval_state_builder)));
|
||||
}
|
||||
|
||||
nix_err nix_eval_state_builder_load(nix_c_context * context, nix_eval_state_builder * builder)
|
||||
|
|
@ -203,7 +203,7 @@ EvalState * nix_state_create(nix_c_context * context, const char ** lookupPath_c
|
|||
|
||||
void nix_state_free(EvalState * state)
|
||||
{
|
||||
delete state;
|
||||
operator delete(state, static_cast<std::align_val_t>(alignof(EvalState)));
|
||||
}
|
||||
|
||||
#if NIX_USE_BOEHMGC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue