git: 858010643c54 - main - 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: Mon, 06 May 2024 18:37:53 UTC
The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=858010643c54c4c03e477ce452b0a0c25ecc405a commit 858010643c54c4c03e477ce452b0a0c25ecc405a Author: Marko Zec <zec@FreeBSD.org> AuthorDate: 2024-05-06 18:34:11 +0000 Commit: Marko Zec <zec@FreeBSD.org> CommitDate: 2024-05-06 18:37:44 +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)