diff options
author | corvid <corvid@lavabit.com> | 2011-09-25 19:32:18 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2011-09-25 19:32:18 +0000 |
commit | a0052fcb7c244fc099743a1a3a36766e9c562920 (patch) | |
tree | 9fa17ccae19bdb0a9e06da990b411db7f8716522 | |
parent | 0e6bd08d58b91be4abbd10f51b9551158d3d6cd8 (diff) |
use-after-free
I accidentally went to the url "80", got an unfamiliar error msg, and
immediately wondered what valgrind would think of this unfamiliar path.
And valgrind found a bug.
-rw-r--r-- | src/IO/http.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/IO/http.c b/src/IO/http.c index 41ee137a..3504d2b3 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -171,10 +171,12 @@ static void Http_connect_queued_sockets(HostConnection_t *hc) } else if (a_Web_valid(sd->web)) { /* start connecting the socket */ if (Http_connect_socket(sd->Info) < 0) { + int localkey = VOIDP2INT(sd->Info->LocalKey); + MSG_BW(sd->web, 1, "ERROR: %s", dStrerror(sd->Err)); a_Chain_bfcb(OpAbort, sd->Info, NULL, "Both"); dFree(sd->Info); - Http_socket_free(VOIDP2INT(sd->Info->LocalKey)); + Http_socket_free(localkey); } else { sd->connected_to = hc->host; hc->active_connections++; |