The hsts_entry() function contains of a single line and is only
used in a single place in the code, so move the allocation into
hsts_create instead to improve code readability. C code usually
don't use the factory abstraction for object creation, and this
small example wasn't following our usual code style.
Closes: #13604
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
}
}
-static struct stsentry *hsts_entry(void)
-{
- return calloc(1, sizeof(struct stsentry));
-}
-
static CURLcode hsts_create(struct hsts *h,
const char *hostname,
bool subdomains,
--hlen;
if(hlen) {
char *duphost;
- struct stsentry *sts = hsts_entry();
+ struct stsentry *sts = calloc(1, sizeof(struct stsentry));
if(!sts)
return CURLE_OUT_OF_MEMORY;