git: e5b853808363 - main - libalias: add another check to previous change

From: Eugene Grosbein <eugen_at_FreeBSD.org>
Date: Tue, 20 Aug 2024 14:04:16 UTC
The branch main has been updated by eugen:

URL: https://cgit.FreeBSD.org/src/commit/?id=e5b85380836378c9e321a4e6d300591e6faf622a

commit e5b85380836378c9e321a4e6d300591e6faf622a
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2024-08-20 14:00:35 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2024-08-20 14:04:13 +0000

    libalias: add another check to previous change
    
    If UseLink() returns NULL, it is possible that Deletelink()
    has already freed "grp", so check it out carefully.
    
    PR:             269770
    Reported by:    Peter Much
    X-MFC-With:     8132e959099f0c533f698d8fbc17386f9144432f
---
 sys/netinet/libalias/alias_db.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c
index d516b6cda96c..4bb95549aaaf 100644
--- a/sys/netinet/libalias/alias_db.c
+++ b/sys/netinet/libalias/alias_db.c
@@ -875,6 +875,9 @@ _FindLinkIn(struct libalias *la, struct in_addr dst_addr,
 				if (found != NULL)
 					return (found);
 				/* link expired */
+				grp = StartPointIn(la, alias_addr, alias_port, link_type, 0);
+				if (grp == NULL)
+					return (NULL);
 				break;
 			}
 		}