[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220211103513.2ebc5615@hermes.local>
Date: Fri, 11 Feb 2022 10:35:13 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Maxim Petrov <mmrmaximuzz@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] libnetlink: fix socket leak in
rtnl_open_byproto()
On Fri, 11 Feb 2022 21:30:11 +0300
Maxim Petrov <mmrmaximuzz@...il.com> wrote:
> Hello Stephen!
>
> On 2022-02-11 01:19 UTC, Stephen Hemminger wrote:
> > + } else {
> > + rth->seq = time(NULL);
> > + return 0;
> > }
>
> For me it looks slightly alien as the normal flow jumps from one 'else if' to
> another, and the final return statement is hidden inside the else block. The
> original version is straightforward and less surprising.
>
> > Can do the same thing without introducing a goto
> But what's wrong with the goto here? I thought it is a perfectly legal C way to
> handle errors, and iproute2 uses it for that purpose almost everywhere.
Ok, either way. personal preference only.
Powered by blists - more mailing lists