From e1dbec0b78671a4e90e578a2ab67b7b114d3b57b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 16 May 2018 11:22:17 +0200 Subject: Fix memory leak reported by valgrind --- src/Cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Cache.cpp') diff --git a/src/Cache.cpp b/src/Cache.cpp index 66b6f71..1295475 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -146,7 +146,7 @@ namespace dchat sf::Texture *texture = new sf::Texture(); if(texture->loadFromMemory(fileContent.data, fileContent.size)) { - delete fileContent.data; + delete[] fileContent.data; fileContent.data = nullptr; texture->setSmooth(true); texture->generateMipmap(); @@ -167,7 +167,7 @@ namespace dchat } } while(offset < fileContent.size); - delete fileContent.data; + delete[] fileContent.data; fileContent.data = nullptr; if(foundHtmlContent) -- cgit v1.2.3