]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: resolvers: remove pool_free(NULL) in SRV additional record matching
authorWilly Tarreau <w@1wt.eu>
Fri, 22 May 2026 07:49:06 +0000 (07:49 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 May 2026 08:57:14 +0000 (10:57 +0200)
In resolv_validate_dns_response(), when matching an additional A/AAAA
record to an SRV record, the code checked tmp_record->ar_item == NULL
then called pool_free(resolv_answer_item_pool, tmp_record->ar_item).
This is a copy-paste mistake from similar patterns elsewhere since
the pointer is confirmed to be NULL a few lines above, so let's just
drop the confusing pool_free.

src/resolvers.c

index 38e61e29ac0073e7027f0a314ff4ae3c5f348d90..6b13aa2f926b1c2f371e3ee12282ed32c8629989 100644 (file)
@@ -1597,7 +1597,6 @@ static int resolv_validate_dns_response(unsigned char *resp, unsigned char *bufe
                                    tmp_record->ar_item == NULL &&
                                    memcmp(tmp_record->data.target, answer_record->name, tmp_record->data_len) == 0) {
                                        /* Always use the received additional record to refresh info */
-                                       pool_free(resolv_answer_item_pool, tmp_record->ar_item);
                                        tmp_record->ar_item = answer_record;
                                        answer_record = NULL;
                                        break;