From fe28f0759672844ae50eb8375af11fd791dc4de1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 25 Jun 2017 06:32:19 -0700 Subject: ffi: fix leak in new union code. * ffi.c (make_ffi_type_union): Create cobj with correct cobj_ops structure: ffi_type_struct_ops, not ffi_type_enum_ops. --- ffi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffi.c b/ffi.c index 0600f83b..f9a20cbc 100644 --- a/ffi.c +++ b/ffi.c @@ -2942,7 +2942,7 @@ static val make_ffi_type_union(val syntax, val lisp_type, cnum nmemb = c_num(length(types)), i; struct smemb *memb = coerce(struct smemb *, chk_calloc(nmemb, sizeof *memb)); - val obj = cobj(coerce(mem_t *, tft), ffi_type_s, &ffi_type_enum_ops); + val obj = cobj(coerce(mem_t *, tft), ffi_type_s, &ffi_type_struct_ops); ucnum most_align = 0; ucnum biggest_size = 0; const unsigned bits_int = 8 * sizeof(int); -- cgit v1.2.3