From: Jérémie Galarneau Date: Sat, 27 May 2017 18:48:20 +0000 (-0400) Subject: Fix: potential NULL dereference of ctf_fs_file path X-Git-Tag: v2.0.0-pre1~154 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=dcbaa1cad50ceea9ac9ec6a7b098db5d372dcbaa Fix: potential NULL dereference of ctf_fs_file path Signed-off-by: Jérémie Galarneau --- diff --git a/plugins/ctf/fs-src/file.c b/plugins/ctf/fs-src/file.c index 0d0ed7e0..61a724b0 100644 --- a/plugins/ctf/fs-src/file.c +++ b/plugins/ctf/fs-src/file.c @@ -45,11 +45,13 @@ void ctf_fs_file_destroy(struct ctf_fs_file *file) ctf_fs = file->ctf_fs; if (file->fp) { - PDBG("Closing file \"%s\" (%p)\n", file->path->str, file->fp); + PDBG("Closing file \"%s\" (%p)\n", + file->path ? file->path->str : NULL, file->fp); if (fclose(file->fp)) { - PERR("Cannot close file \"%s\": %s\n", file->path->str, - strerror(errno)); + PERR("Cannot close file \"%s\": %s\n", + file->path ? file->path->str : "NULL", + strerror(errno)); } }