diff options
| author | Brad King <brad.king@kitware.com> | 2023-12-12 01:33:07 (GMT) |
|---|---|---|
| committer | Brad King <brad.king@kitware.com> | 2023-12-12 01:33:07 (GMT) |
| commit | 548f0cfd1db2f6a4b971df94a0a47655b51ff9d9 (patch) | |
| tree | bbba54962c79e662d7d04986e113f50efd39654e /Utilities/cmcurl/lib/altsvc.c | |
| parent | 38f85b839019c0674e9f8abae141e7b087f44c16 (diff) | |
| parent | fe5ffe06a9e09b7be5ff432049cb427894a78dcb (diff) | |
| download | CMake-548f0cfd1db2f6a4b971df94a0a47655b51ff9d9.zip CMake-548f0cfd1db2f6a4b971df94a0a47655b51ff9d9.tar.gz CMake-548f0cfd1db2f6a4b971df94a0a47655b51ff9d9.tar.bz2 | |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2023-12-06 (7161cb17)
Diffstat (limited to 'Utilities/cmcurl/lib/altsvc.c')
| -rw-r--r-- | Utilities/cmcurl/lib/altsvc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Utilities/cmcurl/lib/altsvc.c b/Utilities/cmcurl/lib/altsvc.c index 22b0b69..35450d6 100644 --- a/Utilities/cmcurl/lib/altsvc.c +++ b/Utilities/cmcurl/lib/altsvc.c @@ -97,7 +97,7 @@ static struct altsvc *altsvc_createid(const char *srchost, unsigned int srcport, unsigned int dstport) { - struct altsvc *as = calloc(sizeof(struct altsvc), 1); + struct altsvc *as = calloc(1, sizeof(struct altsvc)); size_t hlen; size_t dlen; if(!as) @@ -123,15 +123,13 @@ static struct altsvc *altsvc_createid(const char *srchost, dlen -= 2; } - as->src.host = Curl_memdup(srchost, hlen + 1); + as->src.host = Curl_strndup(srchost, hlen); if(!as->src.host) goto error; - as->src.host[hlen] = 0; - as->dst.host = Curl_memdup(dsthost, dlen + 1); + as->dst.host = Curl_strndup(dsthost, dlen); if(!as->dst.host) goto error; - as->dst.host[dlen] = 0; as->src.alpnid = srcalpnid; as->dst.alpnid = dstalpnid; @@ -301,7 +299,7 @@ static CURLcode altsvc_out(struct altsvc *as, FILE *fp) */ struct altsvcinfo *Curl_altsvc_init(void) { - struct altsvcinfo *asi = calloc(sizeof(struct altsvcinfo), 1); + struct altsvcinfo *asi = calloc(1, sizeof(struct altsvcinfo)); if(!asi) return NULL; Curl_llist_init(&asi->list, NULL); |
