diff options
author | Slávek Banko <[email protected]> | 2022-03-12 02:58:49 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2022-03-12 02:58:49 +0100 |
commit | 3d29aa4f852813f6839ef930a5dba8ef7747eaa7 (patch) | |
tree | 9f387cc2ee2e0acf984de732485779ab5899dd6c | |
parent | b2383291c7c6470ff5e70e2a004a010373c19b56 (diff) | |
download | libart-lgpl-3d29aa4f852813f6839ef930a5dba8ef7747eaa7.tar.gz libart-lgpl-3d29aa4f852813f6839ef930a5dba8ef7747eaa7.zip |
Fix possible memory leak in art_render_new.
Signed-off-by: Slávek Banko <[email protected]>
-rw-r--r-- | src/art_render.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/art_render.c b/src/art_render.c index 65b344c..2f74929 100644 --- a/src/art_render.c +++ b/src/art_render.c @@ -48,9 +48,6 @@ art_render_new (int x0, int y0, int x1, int y1, ArtRenderPriv *priv; ArtRender *result; - priv = art_new (ArtRenderPriv, 1); - result = &priv->super; - if (n_chan > ART_MAX_CHAN) { art_warn ("art_render_new: n_chan = %d, exceeds %d max\n", @@ -68,6 +65,10 @@ art_render_new (int x0, int y0, int x1, int y1, art_warn ("art_render_new: x0 >= x1 (x0 = %d, x1 = %d)\n", x0, x1); return NULL; } + + priv = art_new (ArtRenderPriv, 1); + result = &priv->super; + result->x0 = x0; result->y0 = y0; result->x1 = x1; |