These names leak because freeing them in the uninit function has been forgotten. Instead of adding the freeing code, this commit stops allocating these names. They are constants anyway.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -673,27 +673,19 @@ static av_cold int init(AVFilterContext *ctx) · 672 unmodified lines | |||
| 673 | s->inverse = 1; | 673 | s->inverse = 1; |
| 674 | 674 | ||
| 675 | pad.type = AVMEDIA_TYPE_VIDEO; | 675 | pad.type = AVMEDIA_TYPE_VIDEO; |
| 676 | pad.name = av_strdup("main"); | 676 | pad.name = "main"; |
| 677 | pad.config_props = config_input; | 677 | pad.config_props = config_input; |
| 678 | if (!pad.name) | ||
| 679 | return AVERROR(ENOMEM); | ||
| 680 | 678 | ||
| 681 | if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0) { | 679 | if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0) |
| 682 | av_freep(&pad.name); | ||
| 683 | return ret; | 680 | return ret; |
| 684 | } | ||
| 685 | 681 | ||
| 686 | if (!s->inplace) { | 682 | if (!s->inplace) { |
| 687 | pad.type = AVMEDIA_TYPE_VIDEO; | 683 | pad.type = AVMEDIA_TYPE_VIDEO; |
| 688 | pad.name = av_strdup("alpha"); | 684 | pad.name = "alpha"; |
| 689 | pad.config_props = NULL; | 685 | pad.config_props = NULL; |
| 690 | if (!pad.name) | ||
| 691 | return AVERROR(ENOMEM); | ||
| 692 | 686 | ||
| 693 | if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0) { | 687 | if ((ret = ff_insert_inpad(ctx, 1, &pad)) < 0) |
| 694 | av_freep(&pad.name); | ||
| 695 | return ret; | 688 | return ret; |
| 696 | } | ||
| 697 | } | 689 | } |
| 698 | 690 | ||
| 699 | return 0; | 691 | return 0; |