only allocated if initialization worked. This means that on failure, we
don't have to deallocate it.
Originally committed as revision 14924 to svn://svn.ffmpeg.org/ffmpeg/trunk
if (strcmp(proto,"tcp")) goto fail;
if ((q = strchr(hostname,'@'))) { strcpy(tmp,q+1); strcpy(hostname,tmp); }
- s = av_malloc(sizeof(TCPContext));
- if (!s)
- return AVERROR(ENOMEM);
- h->priv_data = s;
- h->is_streamed = 1;
-
if (port <= 0 || port >= 65536)
goto fail;
if (ret != 0)
goto fail;
}
+ s = av_malloc(sizeof(TCPContext));
+ if (!s)
+ return AVERROR(ENOMEM);
+ h->priv_data = s;
+ h->is_streamed = 1;
s->fd = fd;
return 0;
fail1:
if (fd >= 0)
closesocket(fd);
- av_free(s);
return ret;
}