summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/content_encoding.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-27 19:23:20 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-27 19:23:20 (GMT)
commitcd40922edb1ecd052a18cab1a3858546ac06129d (patch)
tree8c2dcdcd5e86504f79af9bcd05080368361266a9 /Utilities/cmcurl/lib/content_encoding.c
parent2f38e5d21472f880ad9ad77a1cd6eb66d0363060 (diff)
parent18b2a8d7604f3aced9c93220806851f96e231f36 (diff)
downloadCMake-cd40922edb1ecd052a18cab1a3858546ac06129d.zip
CMake-cd40922edb1ecd052a18cab1a3858546ac06129d.tar.gz
CMake-cd40922edb1ecd052a18cab1a3858546ac06129d.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2021-05-26 (6b951a69)
Diffstat (limited to 'Utilities/cmcurl/lib/content_encoding.c')
-rw-r--r--Utilities/cmcurl/lib/content_encoding.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Utilities/cmcurl/lib/content_encoding.c b/Utilities/cmcurl/lib/content_encoding.c
index f179b81..a84ff54 100644
--- a/Utilities/cmcurl/lib/content_encoding.c
+++ b/Utilities/cmcurl/lib/content_encoding.c
@@ -178,7 +178,7 @@ static CURLcode inflate_stream(struct Curl_easy *data,
/* Dynamically allocate a buffer for decompression because it's uncommonly
large to hold on the stack */
decomp = malloc(DSIZ);
- if(decomp == NULL)
+ if(!decomp)
return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
/* because the buffer size is fixed, iteratively decompress and transfer to
@@ -487,7 +487,7 @@ static CURLcode gzip_unencode_write(struct Curl_easy *data,
*/
z->avail_in = (uInt) nbytes;
z->next_in = malloc(z->avail_in);
- if(z->next_in == NULL) {
+ if(!z->next_in) {
return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
}
memcpy(z->next_in, buf, z->avail_in);
@@ -509,7 +509,7 @@ static CURLcode gzip_unencode_write(struct Curl_easy *data,
ssize_t hlen;
z->avail_in += (uInt) nbytes;
z->next_in = Curl_saferealloc(z->next_in, z->avail_in);
- if(z->next_in == NULL) {
+ if(!z->next_in) {
return exit_zlib(data, z, &zp->zlib_init, CURLE_OUT_OF_MEMORY);
}
/* Append the new block of data to the previous one */
@@ -985,7 +985,8 @@ new_unencoding_writer(struct Curl_easy *data,
return writer;
}
-/* Write data using an unencoding writer stack. */
+/* Write data using an unencoding writer stack. "nbytes" is not
+ allowed to be 0. */
CURLcode Curl_unencode_write(struct Curl_easy *data,
struct contenc_writer *writer,
const char *buf, size_t nbytes)