From bd449b2ac3abfd923a0a2ffe9045a6fd1b69039e Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 14 Oct 2016 15:07:52 +0300 Subject: [PATCH] Interop/Runtime: properly initialize ffi_type for structs --- Interop/Runtime/src/callbacks/c/callbacks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Interop/Runtime/src/callbacks/c/callbacks.c b/Interop/Runtime/src/callbacks/c/callbacks.c index 622853eb373..44f90608f65 100644 --- a/Interop/Runtime/src/callbacks/c/callbacks.c +++ b/Interop/Runtime/src/callbacks/c/callbacks.c @@ -101,6 +101,8 @@ JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypePointer(J JNIEXPORT jlong JNICALL Java_kotlin_1native_interop_CallbacksKt_ffiTypeStruct0(JNIEnv *env, jclass cls, jlong elements) { ffi_type* res = malloc(sizeof(ffi_type)); if (res != NULL) { + res->size = 0; + res->alignment = 0; res->elements = (ffi_type**) elements; res->type = FFI_TYPE_STRUCT; }