[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231114163617.25a7990f@hermes.local>
Date: Tue, 14 Nov 2023 16:36:17 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: heminhong <heminhong@...inos.cn>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] iproute2: prevent memory leak
On Tue, 14 Nov 2023 17:24:10 +0800
heminhong <heminhong@...inos.cn> wrote:
> + if (NULL != answer)
> + {
> + free(answer);
> + }
Four style problems here:
1. Don't use Windows convention of NULL first
2. Don't use Windows style bracket indentation
3. Brackets are not used in kernel style for single statment if()
4. Since free of NULL is a perfectly valid nop. Just call free() and skip the if.
If you read the existing code, you would see that it uses kernel style.
Any change should follow the conventions of existing code.
Powered by blists - more mailing lists