mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 16:20:03 +01:00
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
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue