Fix vpad.name leak in error path, move the vpad related operation
only if enabled show IR frequency response.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
if (!pad.name)
return AVERROR(ENOMEM);
if (!pad.name)
return AVERROR(ENOMEM);
+ ret = ff_insert_outpad(ctx, 0, &pad);
+ if (ret < 0) {
+ av_freep(&pad.name);
+ return ret;
+ }
+
if (s->response) {
vpad = (AVFilterPad){
.name = av_strdup("filter_response"),
if (s->response) {
vpad = (AVFilterPad){
.name = av_strdup("filter_response"),
};
if (!vpad.name)
return AVERROR(ENOMEM);
};
if (!vpad.name)
return AVERROR(ENOMEM);
- ret = ff_insert_outpad(ctx, 0, &pad);
- if (ret < 0) {
- av_freep(&pad.name);
- return ret;
- }
-
- if (s->response) {
ret = ff_insert_outpad(ctx, 1, &vpad);
if (ret < 0) {
av_freep(&vpad.name);
ret = ff_insert_outpad(ctx, 1, &vpad);
if (ret < 0) {
av_freep(&vpad.name);