diff options
author | Julien Cristau <jcristau@debian.org> | 2016-03-02 21:25:41 +0100 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2016-03-02 21:30:17 +0100 |
commit | 3c01d42e7def429bc8526b24a16323d2db34117b (patch) | |
tree | 9d05a3a5b87e2357f84fe89db9c30aefea9b2600 | |
parent | e6e21d9948539973401880e5fed2915bf09a392b (diff) |
render: free already allocated formats in PictureInit failure case
Probably pointless, if this fails you're not likely to get far...
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | render/picture.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/render/picture.c b/render/picture.c index 6d9c9df3a..9e4036e7d 100644 --- a/render/picture.c +++ b/render/picture.c @@ -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; } |