evas - filter - fix memory leak if cmd not found by curve cmd

This commit is contained in:
Carsten Haitzler 2014-02-13 18:57:01 +09:00
parent bbefeae071
commit a725924b53
1 changed files with 5 additions and 1 deletions

View File

@ -1116,7 +1116,11 @@ evas_filter_command_curve_add(Evas_Filter_Context *ctx,
if (!copy) return -1;
cmd = _command_new(ctx, EVAS_FILTER_MODE_CURVE, in, NULL, out);
if (!cmd) return -1;
if (!cmd)
{
free(copy);
return -1;
}
memcpy(copy, curve, 256 * sizeof(DATA8));
cmd->curve.data = copy;