public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] runner: Fix a memory leak in stderr_contains_warnings
Date: Mon, 14 Nov 2022 15:03:22 +0100	[thread overview]
Message-ID: <Y3JKqlSxLdgqcPFc@kamilkon-desk1> (raw)
In-Reply-To: <20221111080529.2427645-1-petri.latvala@intel.com>

Hi,

On 2022-11-11 at 10:05:29 +0200, Petri Latvala wrote:
> The matches object's internals weren't released.
> 
> Signed-off-by: Petri Latvala <petri.latvala@intel.com>
> Cc: Arkadiusz Hiler <arek@hiler.eu>
> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
>  runner/resultgen.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/runner/resultgen.c b/runner/resultgen.c
> index 3d753828..21a3ed84 100644
> --- a/runner/resultgen.c
> +++ b/runner/resultgen.c
> @@ -1912,6 +1912,8 @@ static bool stderr_contains_warnings(const char *beg, const char *end)
>  		i++;
>  	}
>  
> +	free_matches(&matches);
> +
>  	return false;

On second look you need to free it also before return true ?
So maybe reformat it, use break and then 'return found;' ?

Regards,
Kamil

>  }
>  
> -- 
> 2.30.2
> 

  parent reply	other threads:[~2022-11-14 14:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  8:05 [igt-dev] [PATCH i-g-t] runner: Fix a memory leak in stderr_contains_warnings Petri Latvala
2022-11-11  8:58 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2022-11-12  2:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-11-14 12:52 ` [igt-dev] [PATCH i-g-t] " Kamil Konieczny
2022-11-14 14:03 ` Kamil Konieczny [this message]
2022-11-14 14:06   ` Petri Latvala
2022-11-14 14:10 ` [igt-dev] [PATCH i-g-t v2] " Petri Latvala
2022-11-14 15:18 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Fix a memory leak in stderr_contains_warnings (rev2) Patchwork
2022-11-14 20:50 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3JKqlSxLdgqcPFc@kamilkon-desk1 \
    --to=kamil.konieczny@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox