[bugfix] use-after-free of current file name in logging

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>