git: f68ecf5d4fbd - stable/13 - fib_dxr: free() does nothing if arg is NULL, so remove a redundant check.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 May 2024 20:39:27 UTC
The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=f68ecf5d4fbd69dae868e474ff1f37d38e37c461 commit f68ecf5d4fbd69dae868e474ff1f37d38e37c461 Author: Marko Zec <zec@FreeBSD.org> AuthorDate: 2024-05-06 18:34:11 +0000 Commit: Marko Zec <zec@FreeBSD.org> CommitDate: 2024-05-14 20:35:28 +0000 fib_dxr: free() does nothing if arg is NULL, so remove a redundant check. MFC after: 1 week --- sys/netinet/in_fib_dxr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index db4f4a537e22..55f79994f552 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1142,14 +1142,11 @@ static void dxr_destroy(void *data) { struct dxr *dxr = data; - struct dxr_aux *da; + struct dxr_aux *da = dxr->aux; struct chunk_desc *cdp; struct trie_desc *tp; - if (dxr->d != NULL) - free(dxr->d, M_DXRLPM); - - da = dxr->aux; + free(dxr->d, M_DXRLPM); free(dxr, M_DXRAUX); if (da == NULL || atomic_fetchadd_int(&da->refcnt, -1) > 1)