Fix possible race condition

This commit is contained in:
Giuseppe Scrivano 2013-06-23 21:16:13 +02:00
parent fec5bb9e93
commit 74d5c8bfb7
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2013-06-23 Giuseppe Scrivano <gscrivano@gnu.org>
* http.c (gethttp): Lock access to `connect_to_host'.
2013-06-03 Jochen Hein <jochen@jochen.org> (tiny change)
* main.c (main): Remove double empty space from string.

View File

@ -2244,7 +2244,9 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
if (sock < 0)
{
PCONN_LOCK();
sock = connect_to_host (conn->host, conn->port);
PCONN_UNLOCK();
if (sock == E_HOST)
{
request_free (req);