Commit c97aa7ed authored by Michael Smith's avatar Michael Smith

Fix double-close under error conditions in http login. Bug found by Karl Heyes.

svn path=/trunk/libshout/; revision=4281
parent ad4e4dad
......@@ -828,13 +828,11 @@ static int login_http_basic(shout_t *self)
/* assume we'll have to authenticate, saves round trips on basic */
if(send_http_request(self, self->user, self->password) != 0) {
#endif
sock_close(self->socket);
return self->error = SHOUTERR_SOCKET;
}
if (util_read_header(self->socket, header, 4096) == 0) {
/* either we didn't get a complete header, or we timed out */
sock_close(self->socket);
return self->error = SHOUTERR_SOCKET;
}
......@@ -887,7 +885,6 @@ static int login_http_basic(shout_t *self)
}
httpp_destroy(parser);
sock_close(self->socket);
return self->error = SHOUTERR_REFUSED;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment