tidy-up: drop stray casts for allocated pointers

Closes #21865
This commit is contained in:
Viktor Szakats 2026-06-05 01:23:06 +02:00
parent cb307544ad
commit 1b8f4dba28
No known key found for this signature in database
16 changed files with 22 additions and 32 deletions

View file

@ -576,13 +576,12 @@ CURLcode curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...)
case CURLINFO_CERTINFO:
cipf = *(struct curl_certinfo **)paramp;
if(cipf) {
cipt = (struct curl_certinfo *)malloc(sizeof(*cipt));
cipt = malloc(sizeof(*cipt));
if(!cipt)
result = CURLE_OUT_OF_MEMORY;
else {
cipt->certinfo =
(struct curl_slist **)calloc(cipf->num_of_certs + 1,
sizeof(struct curl_slist *));
cipt->certinfo = calloc(cipf->num_of_certs + 1,
sizeof(struct curl_slist *));
if(!cipt->certinfo)
result = CURLE_OUT_OF_MEMORY;
else {

View file

@ -149,7 +149,7 @@ int main(int argsc, struct arguments *args)
if(!exitcode) {
/* Allocate space for parsed arguments. */
argv = (char **)malloc((argc + 1) * sizeof(*argv) + argsize);
argv = malloc((argc + 1) * sizeof(*argv) + argsize);
if(!argv) {
fputs("Memory allocation error\n", stderr);
exitcode = -2;

View file

@ -86,7 +86,7 @@ int main(int argc, char **argv)
}
/* Allocate memory for the ASCII arguments and vector. */
argv = (char **)malloc((argc + 1) * sizeof(*argv) + bytecount);
argv = malloc((argc + 1) * sizeof(*argv) + bytecount);
/* Build the vector and convert argument encoding. */
outbuf = (char *)(argv + argc + 1);