mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
resolved: simplify min_ttl check
rr is asserted upon a few lines above, no need to check for null. Coverity-found issue, CID 1450844 CID 1450844: Null pointer dereferences (REVERSE_INULL) Null-checking "rr" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
This commit is contained in:
parent
04820600e7
commit
18da936481
@ -439,9 +439,7 @@ static int dns_cache_put_positive(
|
||||
/* Determine the minimal TTL of all RRs in the answer plus the one by the main RR we are supposed to
|
||||
* cache. Since we cache whole answers to questions we should never return answers where only some
|
||||
* RRs are still valid, hence find the lowest here */
|
||||
min_ttl = dns_answer_min_ttl(answer);
|
||||
if (rr)
|
||||
min_ttl = MIN(min_ttl, rr->ttl);
|
||||
min_ttl = MIN(dns_answer_min_ttl(answer), rr->ttl);
|
||||
|
||||
/* New TTL is 0? Delete this specific entry... */
|
||||
if (min_ttl <= 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user