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>
This commit is contained in:
parent
054f807178
commit
4217db89ec
|
@ -665,6 +665,9 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
||||||
for (n = 0; n < nformats; n++) {
|
for (n = 0; n < nformats; n++) {
|
||||||
if (!AddResource
|
if (!AddResource
|
||||||
(formats[n].id, PictFormatType, (void *) (formats + n))) {
|
(formats[n].id, PictFormatType, (void *) (formats + n))) {
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < n; i++)
|
||||||
|
FreeResource(formats[i].id, RT_NONE);
|
||||||
free(formats);
|
free(formats);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue