From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeremie.galarneau@efficios.com (=?UTF-8?Q?J=C3=A9r=C3=A9mie_Galarneau?=) Date: Wed, 18 May 2016 16:08:03 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Double free in utils_partial_realpath error path In-Reply-To: <1463588247-28885-1-git-send-email-mjeanson@efficios.com> References: <1463588247-28885-1-git-send-email-mjeanson@efficios.com> Message-ID: Merged, thanks! Jérémie On Wed, May 18, 2016 at 12:17 PM, Michael Jeanson wrote: > Fixes coverity #1355521 > > Signed-off-by: Michael Jeanson > --- > src/common/utils.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/common/utils.c b/src/common/utils.c > index 30a5f10..901ddb0 100644 > --- a/src/common/utils.c > +++ b/src/common/utils.c > @@ -190,7 +190,9 @@ error: > free(resolved_path); > free(cut_path); > free(try_path); > - free(try_path_prev); > + if (try_path_prev != try_path) { > + free(try_path_prev); > + } > return NULL; > } > > -- > 2.7.4 > -- Jérémie Galarneau EfficiOS Inc. http://www.efficios.com