History

avformat/udp: check for memory allocation failure when setting localaddr

jackarain committed 3 years ago

Commit 05ea0451 parent f758d4f1 file · +4 −0Browse files

Unified · Split

libavformat/udp.c+4−0
@@ -740,6 +740,10 @@ static int udp_open(URLContext *h, const char *uri, int flags) · 739 unmodified lines
740740 if (av_find_info_tag(buf, sizeof(buf), "localaddr", p)) {
741741 av_freep(&s->localaddr);
742742 s->localaddr = av_strdup(buf);
743+ if (!s->localaddr) {
744+ ret = AVERROR(ENOMEM);
745+ goto fail;
746+ }
743747 }
744748 if (av_find_info_tag(buf, sizeof(buf), "sources", p)) {
745749 if ((ret = ff_ip_parse_sources(h, buf, &s->filters)) < 0)

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