lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACbG30--zoPwzFqda3Dns2sRibdMkPha+agNip82aCLBGoGjjQ@mail.gmail.com>
Date:   Thu, 13 Oct 2016 15:05:40 -0500
From:   Nilay Vaish <nilayvaish@...il.com>
To:     Stephane Eranian <eranian@...gle.com>
Cc:     Linux Kernel list <linux-kernel@...r.kernel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        jolsa@...hat.com, peterz@...radead.org, mingo@...e.hu,
        anton@...abs.org, namhyung@...nel.org
Subject: Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI

On 13 October 2016 at 05:59, Stephane Eranian <eranian@...gle.com> wrote:
> diff --git a/tools/perf/jvmti/libjvmti.c b/tools/perf/jvmti/libjvmti.c
> index ac12e4b91a92..2d9bc04b79a8 100644
> --- a/tools/perf/jvmti/libjvmti.c
> +++ b/tools/perf/jvmti/libjvmti.c
> @@ -12,6 +12,17 @@
>  static int has_line_numbers;
>  void *jvmti_agent;
>
> +static void print_error(jvmtiEnv *jvmti, const char *msg, jvmtiError ret)
> +{
> +       char *err_msg = NULL;
> +       jvmtiError err;
> +       err = (*jvmti)->GetErrorName(jvmti, ret, &err_msg);
> +       if (err == JVMTI_ERROR_NONE) {
> +               warnx("%s failed with %s", msg, err_msg);
> +               (*jvmti)->Deallocate(jvmti, (unsigned char *)err_msg);
> +       }
> +}

Do we not need to release the memory for err_msg if the condition for
the 'if' statement evaluates to false?  Is it that we are going to
kill the process, so no need to release the memory?

--
Nilay

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ