From: Michael Jeanson Date: Tue, 17 May 2016 19:09:03 +0000 (-0400) Subject: Fix: Don't dereference null ptr in error path X-Git-Tag: v1.4.0~11 X-Git-Url: https://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=80715793a0776d0bdcb8f04de68961086f8cd006 Fix: Don't dereference null ptr in error path Fixes coverity #1355339 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index c5d654c9..bc962121 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -2431,8 +2431,10 @@ struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags, return &td->parent; error: - trace_debug_info_destroy(td); - g_free(td); + if (td) { + trace_debug_info_destroy(td); + g_free(td); + } return NULL; }