From: Eric Sunshine Date: Thu, 26 Aug 2021 15:58:25 GMT Subject: Re: [PATCH v2 4/6] tr2: fix memory leak & logic error in 2f732bf15e6 Message-ID: In-Reply-To: On Thu, Aug 26, 2021 at 8:22 AM Ævar Arnfjörð Bjarmason wrote: > [...] > Let's move all the freeing of the memory to the end of the > function. If we're still at STRBUF_INIT with "name" due to not haven s/haven/having/ > taken the branch where the strbuf_read_file() succeeds freeing it is > redundant, so we could move it into the body of the "if", but just > handling freeing the same way for all branches of the function makes > it more readable. > [...] > Signed-off-by: Ævar Arnfjörð Bjarmason