libexpr: use allocBytes() to allocate StringData
This commit is contained in:
@@ -515,7 +515,7 @@ nix_err nix_init_string(nix_c_context * context, nix_value * value, const char *
|
||||
context->last_err_code = NIX_OK;
|
||||
try {
|
||||
auto & v = check_value_out(value);
|
||||
v.mkString(std::string_view(str));
|
||||
v.mkString(std::string_view(str), *value->mem);
|
||||
}
|
||||
NIXC_CATCH_ERRS
|
||||
}
|
||||
@@ -526,7 +526,7 @@ nix_err nix_init_path_string(nix_c_context * context, EvalState * s, nix_value *
|
||||
context->last_err_code = NIX_OK;
|
||||
try {
|
||||
auto & v = check_value_out(value);
|
||||
v.mkPath(s->state.rootPath(nix::CanonPath(str)));
|
||||
v.mkPath(s->state.rootPath(nix::CanonPath(str)), s->state.mem);
|
||||
}
|
||||
NIXC_CATCH_ERRS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user