If http_connect fails, we've already stored the new connection handle in s->hd,
so clear it so http_close won't double-free it.
10l to me for not spotting it during review
Originally committed as revision 23529 to svn://svn.ffmpeg.org/ffmpeg/trunk
fail:
if (hd)
url_close(hd);
+ s->hd = NULL;
return AVERROR(EIO);
}
s->chunksize = -1;
s->off = 0;
s->init = 0;
+ s->hd = NULL;
*s->headers = '\0';
memset(&s->auth_state, 0, sizeof(s->auth_state));
av_strlcpy(s->location, uri, URL_SIZE);
ret = ret > 0 ? 0 : ret;
}
- url_close(s->hd);
+ if (s->hd)
+ url_close(s->hd);
av_free(s);
return ret;
}