<AWT Dev> RFR JDK-8171836: Memory leak in java.desktop/unix/native/common/awt/fontpath.c

Ambarish Rapte ambarish.rapte at oracle.com
Thu Dec 22 05:35:24 UTC 2016


Hi Abhijit,

                There can be references added to newFontPath[] in previous iterations of loop at Line 298: newFontPath[nPaths++] = onePath;

 

                So these references should also be freed, something similar to code at line 308:

 

                for ( index = origNumPaths; index < totalDirCount; index++ ) {

                                free( newFontPath[index] );

}

 

As many references added to newFontPath should be freed accordingly.

 

Regards,

Ambarish

 

From: Abhijit Roy 
Sent: Thursday, December 22, 2016 12:08 AM
To: Vadim Pakhnushev; awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> RFR JDK-8171836: Memory leak in java.desktop/unix/native/common/awt/fontpath.c

 

Hi Vadim,

Yes. I did a mistake here. Please find the correct webrev below.

Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Erpatil/8171836/webrev.01/"http://cr.openjdk.java.net/~rpatil/8171836/webrev.01/


Thanks
Abhijit

On 12/21/2016 7:47 PM, Vadim Pakhnushev wrote:

Abhijit, 
I think there's some misunderstanding here.
The pointer you are trying to free is NULL already:

     if ( newFontPath == NULL ) {
       free ( ( void *) appendDirList );
+      free((void*) newFontPath);

Thanks,
Vadim

On 21.12.2016 16:02, Abhijit Roy wrote:

Hi all,
 
 
 
Please review the fix for the bug below:
 
Bug: https://bugs.openjdk.java.net/browse/JDK-8171836
 
Description: Memory leak in java.desktop/unix/native/common/awt/fontpath.c
 
Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Erpatil/8171836/webrev.00/"http://cr.openjdk.java.net/~rpatil/8171836/webrev.00/
 
 
To prevent memory leak issue, I have released the newFontPath in java.desktop/unix/native/common/awt/fontpath. 
Moving forward it for review.
 
 
 
Regards,
 
Abhijit

 

 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20161221/1fff7df2/attachment-0001.html>


More information about the awt-dev mailing list