Skip to content
Permalink
Browse files
8260432: allocateSpaceForGP in freetypeScaler.c might leak memory
Reviewed-by: shade, stuefe
  • Loading branch information
MBaesken committed Jan 28, 2021
1 parent abc4300 commit 3aabbd72161c9ae970d7b43b764b7ce252e65db7
Showing 1 changed file with 12 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1285,10 +1285,18 @@ static int allocateSpaceForGP(GPData* gpdata, int npoints, int ncontours) {
}

/* failure if any of mallocs failed */
if (gpdata->pointTypes == NULL || gpdata->pointCoords == NULL)
if (gpdata->pointTypes == NULL || gpdata->pointCoords == NULL) {
if (gpdata->pointTypes != NULL) {
free(gpdata->pointTypes);
gpdata->pointTypes = NULL;
}
if (gpdata->pointCoords != NULL) {
free(gpdata->pointCoords);
gpdata->pointCoords = NULL;
}
return 0;
else
return 1;
}
return 1;
}

static void addSeg(GPData *gp, jbyte type) {

1 comment on commit 3aabbd7

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 3aabbd7 Jan 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.