mirror of
https://github.com/curl/curl.git
synced 2024-12-21 06:50:10 +08:00
altsvc: free 'as' when returning error
Closes #12570 Signed-off-by: zengwei <zengwei1@uniontech.com>
This commit is contained in:
parent
95a882d268
commit
8d23a40ba6
@ -106,9 +106,11 @@ static struct altsvc *altsvc_createid(const char *srchost,
|
||||
dlen = strlen(dsthost);
|
||||
DEBUGASSERT(hlen);
|
||||
DEBUGASSERT(dlen);
|
||||
if(!hlen || !dlen)
|
||||
if(!hlen || !dlen) {
|
||||
/* bad input */
|
||||
free(as);
|
||||
return NULL;
|
||||
}
|
||||
if((hlen > 2) && srchost[0] == '[') {
|
||||
/* IPv6 address, strip off brackets */
|
||||
srchost++;
|
||||
|
Loading…
Reference in New Issue
Block a user