Files
simplex-chat/apps
Narasimha-scandEvgeny Poberezkin d72f68e6dc android, desktop: free strings returned by the core (#7595)
The core allocates every chat_* response with malloc and passes ownership to
the caller, as iOS does in API.swift. Both JNI bindings copied the bytes into a
Java string and dropped the pointer, so every command, event and file read
leaked its whole response into the C allocator - invisible to both the JVM and
the Haskell heap profiler.

Desktop frees in decode_to_utf8_string, the funnel every entry point already
goes through. Android has no such funnel because NewStringUTF is called inline,
so decode_and_free is added and the call sites routed through it. chatReadFile
frees directly on both.

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
2026-10-10 19:08:35 +01:00
..