- Fix - instead of make a fixed malloc(50), just do a char addrstr[50]

(cherry picked from commit 97af8f63e3)
This commit is contained in:
Benny Morgan 2013-06-30 21:41:16 +02:00 committed by Adam Sutton
parent 1955888d18
commit 2b8c6d67d4

View file

@ -247,12 +247,11 @@ void
http_error(http_connection_t *hc, int error)
{
const char *errtxt = http_rc2str(error);
char *addrstr = (char*)malloc(50);
char addrstr[50];
tcp_get_ip_str((struct sockaddr*)hc->hc_peer, addrstr, 50);
tvhlog(LOG_ERR, "HTTP", "%s: %s -- %d",
addrstr, hc->hc_url, error);
free(addrstr);
htsbuf_queue_flush(&hc->hc_reply);