mirror of
https://github.com/curl/curl.git
synced 2025-09-14 08:02:44 +03: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);
|
dlen = strlen(dsthost);
|
||||||
DEBUGASSERT(hlen);
|
DEBUGASSERT(hlen);
|
||||||
DEBUGASSERT(dlen);
|
DEBUGASSERT(dlen);
|
||||||
if(!hlen || !dlen)
|
if(!hlen || !dlen) {
|
||||||
/* bad input */
|
/* bad input */
|
||||||
|
free(as);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
if((hlen > 2) && srchost[0] == '[') {
|
if((hlen > 2) && srchost[0] == '[') {
|
||||||
/* IPv6 address, strip off brackets */
|
/* IPv6 address, strip off brackets */
|
||||||
srchost++;
|
srchost++;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user