From 2a48e5aeb946dcfcb0a6c6bbf429354cb0fd5b4e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 16 Aug 2017 15:40:02 -0400 Subject: [PATCH] Fix sink.ctf.fs: NULL dereference in logging statement MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- plugins/ctf/fs-src/data-stream-file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/ctf/fs-src/data-stream-file.c b/plugins/ctf/fs-src/data-stream-file.c index b49a32f6..76ea9ad5 100644 --- a/plugins/ctf/fs-src/data-stream-file.c +++ b/plugins/ctf/fs-src/data-stream-file.c @@ -63,10 +63,11 @@ int ds_file_munmap(struct ctf_fs_ds_file *ds_file) } if (bt_munmap(ds_file->mmap_addr, ds_file->mmap_len)) { - BT_LOGE("Cannot memory-unmap address %p (size %zu) of file \"%s\" (%p): %s", + BT_LOGE_ERRNO("Cannot memory-unmap file", + ": address=%p, size=%zu, file_path=\"%s\", file=%p", ds_file->mmap_addr, ds_file->mmap_len, - ds_file->file->path->str, ds_file->file->fp, - strerror(errno)); + ds_file->file->path->str, + ds_file->file ? ds_file->file->fp : NULL); ret = -1; goto end; } -- 2.34.1