checksrc: detect more kinds of NULL comparisons we avoid

Co-authored-by: Jay Satiro
Closes #8180
This commit is contained in:
Daniel Stenberg 2021-12-25 21:41:14 +01:00
parent acaa79f961
commit 21248e052d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
36 changed files with 87 additions and 87 deletions

View file

@ -3311,7 +3311,7 @@ checkhttpprefix(struct Curl_easy *data,
#ifdef CURL_DOES_CONVERSIONS
/* convert from the network encoding using a scratch area */
char *scratch = strdup(s);
if(NULL == scratch) {
if(!scratch) {
failf(data, "Failed to allocate memory for conversion!");
return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */
}
@ -3351,7 +3351,7 @@ checkrtspprefix(struct Curl_easy *data,
#ifdef CURL_DOES_CONVERSIONS
/* convert from the network encoding using a scratch area */
char *scratch = strdup(s);
if(NULL == scratch) {
if(!scratch) {
failf(data, "Failed to allocate memory for conversion!");
return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */
}