Fix possible memory leak in art_render_new.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 3 years ago
parent b2383291c7
commit 3d29aa4f85
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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;

Loading…
Cancel
Save