render: free already allocated formats in PictureInit failure case
Probably pointless, if this fails you're not likely to get far...
Reviewed-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 4217db89ec
)
This commit is contained in:
parent
518a0c179f
commit
b7e1f25005
|
@ -665,6 +665,9 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
|||
for (n = 0; n < nformats; n++) {
|
||||
if (!AddResource
|
||||
(formats[n].id, PictFormatType, (void *) (formats + n))) {
|
||||
int i;
|
||||
for (i = 0; i < n; i++)
|
||||
FreeResource(formats[i].id, RT_NONE);
|
||||
free(formats);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue