From: "Jérémie Galarneau" <jeremie.galarneau@efficios.com>
To: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Cc: "lttng-dev@lists.lttng.org" <lttng-dev@lists.lttng.org>,
Jeremie Galarneau <jgalar@efficios.com>
Subject: Re: [PATCH lttng-tools] Fix: null dereference on error path for create_ctx_type
Date: Wed, 25 Jan 2017 19:32:54 -0500 [thread overview]
Message-ID: <CA+jJMxtnRVg8N1CXGcFuxFD-bb_R9eJyGDt9o504ZOD9y501kw__40006.8267401823$1485390877$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <1484665727-24204-1-git-send-email-jonathan.rajotte-julien@efficios.com>
Merged in master, stable-2.9 and stable-2.8.
Thanks!
Jérémie
On 17 January 2017 at 10:08, Jonathan Rajotte
<jonathan.rajotte-julien@efficios.com> wrote:
> When zmalloc of type->opt fail the destroy_ctx_type would result in a
> null dereference.
>
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
> ---
> src/bin/lttng/commands/add_context.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/bin/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c
> index 5fc65bf..df722bb 100644
> --- a/src/bin/lttng/commands/add_context.c
> +++ b/src/bin/lttng/commands/add_context.c
> @@ -662,7 +662,9 @@ void destroy_ctx_type(struct ctx_type *type)
> if (!type) {
> return;
> }
> - free(type->opt->symbol);
> + if (type->opt) {
> + free(type->opt->symbol);
> + }
> free(type->opt);
> free(type);
> }
> --
> 2.7.4
>
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
next parent reply other threads:[~2017-01-26 0:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1484665727-24204-1-git-send-email-jonathan.rajotte-julien@efficios.com>
2017-01-26 0:32 ` Jérémie Galarneau [this message]
2017-01-17 15:08 [PATCH lttng-tools] Fix: null dereference on error path for create_ctx_type Jonathan Rajotte
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='CA+jJMxtnRVg8N1CXGcFuxFD-bb_R9eJyGDt9o504ZOD9y501kw__40006.8267401823$1485390877$gmane$org@mail.gmail.com' \
--to=jeremie.galarneau@efficios.com \
--cc=jgalar@efficios.com \
--cc=jonathan.rajotte-julien@efficios.com \
--cc=lttng-dev@lists.lttng.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.