Skip to content

Commit 2872c8e

Browse files
committed
Fix leaks in nix_api_store_test.nix_eval_state_lookup_path
1 parent 57f526e commit 2872c8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libexpr-tests/nix_api_expr.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ TEST_F(nix_api_expr_test, nix_eval_state_lookup_path)
4242
nix_expr_eval_from_string(ctx, state, "builtins.seq <nixos-config> <nixpkgs>", ".", value);
4343
assert_ctx_ok();
4444

45+
nix_state_free(state);
46+
4547
ASSERT_EQ(nix_get_type(ctx, value), NIX_TYPE_PATH);
4648
assert_ctx_ok();
4749

4850
auto pathStr = nix_get_path_string(ctx, value);
4951
assert_ctx_ok();
5052
ASSERT_EQ(0, strcmp(pathStr, nixpkgs.c_str()));
53+
54+
nix_gc_decref(nullptr, value);
5155
}
5256

5357
TEST_F(nix_api_expr_test, nix_expr_eval_from_string)

0 commit comments

Comments
 (0)