mirror of
https://github.com/curl/curl.git
synced 2026-08-25 16:23:36 +03:00
checksrc: warn for assignments within if() expressions
... they're already frowned upon in our source code style guide, this now enforces the rule harder.
This commit is contained in:
parent
b228d2952b
commit
1c3e8bbfed
86 changed files with 413 additions and 226 deletions
|
|
@ -80,15 +80,18 @@ static Curl_addrinfo *fake_ai(void)
|
|||
|
||||
ss_size = sizeof(struct sockaddr_in);
|
||||
|
||||
if((ai = calloc(1, sizeof(Curl_addrinfo))) == NULL)
|
||||
ai = calloc(1, sizeof(Curl_addrinfo));
|
||||
if(!ai)
|
||||
return NULL;
|
||||
|
||||
if((ai->ai_canonname = strdup("dummy")) == NULL) {
|
||||
ai->ai_canonname = strdup("dummy");
|
||||
if(!ai->ai_canonname) {
|
||||
free(ai);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((ai->ai_addr = calloc(1, ss_size)) == NULL) {
|
||||
ai->ai_addr = calloc(1, ss_size);
|
||||
if(!ai->ai_addr) {
|
||||
free(ai->ai_canonname);
|
||||
free(ai);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue