History

fftools/ffmpeg_filter: do not leak graph_desc on fg_create() failure

fg_create() is passed a malloced string and assumed to always take ownership of it.

Anton Khirnov committed 2 years ago

Commit 84c2ca61 parent 181c2041 file · +4 −1Browse files

Unified · Split

fftools/ffmpeg_filter.c+4−1
@@ -1058,8 +1058,10 @@ int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch) · 1057 unmodified lines
10581058 int ret = 0;
10591059
10601060 fgp = av_mallocz(sizeof(*fgp));
1061− if (!fgp)
1061+ if (!fgp) {
1062+ av_freep(&graph_desc);
10621063 return AVERROR(ENOMEM);
1064+ }
10631065 fg = &fgp->fg;
10641066
10651067 if (pfg) {
@@ -1068,6 +1070,7 @@ int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch) · 2 unmodified lines
10681070 } else {
10691071 ret = av_dynarray_add_nofree(&filtergraphs, &nb_filtergraphs, fgp);
10701072 if (ret < 0) {
1073+ av_freep(&graph_desc);
10711074 av_freep(&fgp);
10721075 return ret;
10731076 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t