On code inspection it is revealed that in jpegloader.c->decompressIndirect() we are allocating memory for "scanline_ptr", but if we error_exit() from jpeg_read_scanlines() we are not releasing this memory.
Added release of "scanline_ptr" with NULL check at appropriate places. As part of this fix also added RELEASE_ARRAYS() call for stream/pixel buffer in all cases where we move back to Java code. Its difficult to create definite pass/fail regression test for memory leak, added noreg-hard label in JBS. ------------- Commit messages: - 8309508: Possible memory leak in JPEG image loader Changes: https://git.openjdk.org/jfx/pull/1151/files Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1151&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8309508 Stats: 14 lines in 1 file changed: 9 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jfx/pull/1151.diff Fetch: git fetch https://git.openjdk.org/jfx.git pull/1151/head:pull/1151 PR: https://git.openjdk.org/jfx/pull/1151