fix possible memory leak

This commit is contained in:
bertliao 2018-02-25 12:18:46 +08:00
parent 9acb0cb16c
commit b2fe592d32

View File

@ -45,7 +45,7 @@ static int build_url (char **url, const char *host, int port, const char *path)
assert (path != NULL);
len = strlen (host) + strlen (path) + 14;
*url = (char *) safemalloc (len);
*url = (char *) saferealloc (*url, len);
if (*url == NULL)
return -1;