On Tue, 10 Oct 2023 12:03:23 GMT, Jayathirth D V <j...@openjdk.org> wrote:

> In MTLSurfaceData_initOps() we return if "(gc == NULL)" but we don't free 
> already allocated "mtlsdo" using (MTLSDOps *)malloc(sizeof(MTLSDOps)) which 
> is of 40 bytes.
> 
> We need to free(mtlsdo) before we return from MTLSurfaceData_initOps() for 
> any reasons. Moved (mtlsdo == NULL) check right after we allocate it and 
> added logic to delete mtlsdo(40 bytes) at appropriate places.
> 
> There is no regression test because to reproduce this issue we need to 
> exhaust system memory.

This pull request has now been integrated.

Changeset: 3aa4cba1
Author:    Jayathirth D V <j...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/3aa4cba17520a488aa4a338a80f573af10d3e657
Stats:     12 lines in 1 file changed: 5 ins; 5 del; 2 mod

8316975: Memory leak in MTLSurfaceData

Reviewed-by: prr

-------------

PR: https://git.openjdk.org/jdk/pull/16117

Reply via email to