Core/Logging: Fix mem leak. Thanks to @Sar777 for the report