History

avformat/rtsp: fix leak of options dict on error

Fix CID 1655306

Marvin Scholz committed 1 year ago

Commit 82aeee31 parent 853ad9e1 file · +3 −0Browse files

Unified · Split

libavformat/rtsp.c+3−0
@@ -1847,6 +1847,7 @@ redirect: · 1846 unmodified lines
1847 /* GET requests */1847 /* GET requests */
1848 if (ffurl_alloc(&rt->rtsp_hd, httpname, AVIO_FLAG_READ,1848 if (ffurl_alloc(&rt->rtsp_hd, httpname, AVIO_FLAG_READ,
1849 &s->interrupt_callback) < 0) {1849 &s->interrupt_callback) < 0) {
1850 av_dict_free(&options);
1850 err = AVERROR(EIO);1851 err = AVERROR(EIO);
1851 goto fail;1852 goto fail;
1852 }1853 }
@@ -1863,6 +1864,7 @@ redirect: · 10 unmodified lines
1863 if (!rt->rtsp_hd->protocol_whitelist && s->protocol_whitelist) {1864 if (!rt->rtsp_hd->protocol_whitelist && s->protocol_whitelist) {
1864 rt->rtsp_hd->protocol_whitelist = av_strdup(s->protocol_whitelist);1865 rt->rtsp_hd->protocol_whitelist = av_strdup(s->protocol_whitelist);
1865 if (!rt->rtsp_hd->protocol_whitelist) {1866 if (!rt->rtsp_hd->protocol_whitelist) {
1867 av_dict_free(&options);
1866 err = AVERROR(ENOMEM);1868 err = AVERROR(ENOMEM);
1867 goto fail;1869 goto fail;
1868 }1870 }
@@ -1878,6 +1880,7 @@ redirect: · 9 unmodified lines
1878 /* POST requests */1880 /* POST requests */
1879 if (ffurl_alloc(&rt->rtsp_hd_out, httpname, AVIO_FLAG_WRITE,1881 if (ffurl_alloc(&rt->rtsp_hd_out, httpname, AVIO_FLAG_WRITE,
1880 &s->interrupt_callback) < 0 ) {1882 &s->interrupt_callback) < 0 ) {
1883 av_dict_free(&options);
1881 err = AVERROR(EIO);1884 err = AVERROR(EIO);
1882 goto fail;1885 goto fail;
1883 }1886 }

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