diff options
author | Julien Cristau <jcristau@debian.org> | 2016-03-07 23:20:33 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-03-08 10:20:10 -0500 |
commit | 4217db89ecd480fda2ee74fecba06c6713c2a0f0 (patch) | |
tree | 91c6db92c48c31b1885f9c3f86f6b1518ded267e /render/picture.c | |
parent | 054f80717812d4781741cd05393623fe6f6c627f (diff) |
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>
Diffstat (limited to 'render/picture.c')
-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; } |