[OpenJDK 2D-Dev] RFR: JDK-8260432: allocateSpaceForGP in freetypeScaler.c might leak memory [v2]

Aleksey Shipilev shade at openjdk.java.net
Thu Jan 28 07:56:45 UTC 2021


On Thu, 28 Jan 2021 07:53:44 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   JDK-8260426
>
> This looks fine to me, modulo stylistic nits

Pull from master to get x86_32 GHA jobs fixed and running.

> src/java.desktop/share/native/libfontmanager/freetypeScaler.c line 1289:
> 
>> 1287:     /* failure if any of mallocs failed */
>> 1288:     if (gpdata->pointTypes == NULL || gpdata->pointCoords == NULL) {
>> 1289:         if (gpdata->pointTypes != NULL)  { free(gpdata->pointTypes); gpdata->pointTypes = NULL; }
> 
> You might want to add an extra space before `gpdata->pointTypes = NULL;` to align the statements vertically. You call.

Can we also style it consistently, like:

  if (gpdata->pointTypes != NULL)  { 
      free(gpdata->pointTypes);
      gpdata->pointTypes = NULL;
  }
  if (gpdata->pointCoords != NULL) {
      free(gpdata->pointCoords);
      gpdata->pointCoords = NULL;
  }

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

PR: https://git.openjdk.java.net/jdk/pull/2250


More information about the 2d-dev mailing list