Minor cleanup

This commit is contained in:
twinaphex 2020-08-11 06:35:12 +02:00
parent c7f839a7fd
commit 4092fd7e83

View File

@ -327,10 +327,7 @@ bool net_http_connection_done(struct http_connection_t *conn)
{ {
int has_port = 0; int has_port = 0;
if (!conn) if (!conn || !conn->domain || !*conn->domain)
return false;
if (!conn->domain || !*conn->domain)
return false; return false;
if (*conn->scan == ':') if (*conn->scan == ':')
@ -394,11 +391,9 @@ bool net_http_connection_done(struct http_connection_t *conn)
return true; return true;
} }
else
{
/* invalid character after domain/port */ /* invalid character after domain/port */
return false; return false;
}
} }
void net_http_connection_free(struct http_connection_t *conn) void net_http_connection_free(struct http_connection_t *conn)
@ -430,7 +425,8 @@ void net_http_connection_free(struct http_connection_t *conn)
free(conn); free(conn);
} }
void net_http_connection_set_user_agent(struct http_connection_t* conn, const char* user_agent) void net_http_connection_set_user_agent(
struct http_connection_t* conn, const char* user_agent)
{ {
if (conn->useragentcopy) if (conn->useragentcopy)
free(conn->useragentcopy); free(conn->useragentcopy);