From 7c9ab0e51ad3256ab836cf370a16e93099c65ed6 Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Tue, 7 Mar 2017 20:50:43 +0100 Subject: SLS: fix conditional memleak A memleak occured when non-raw mode was used and a slide complied to the following conditions: - PNG/JPG file - 320x240 resolution or less - size above max slide size (~50 KB) Closes #2. --- src/sls.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/sls.cpp b/src/sls.cpp index 5031451..dcae806 100644 --- a/src/sls.cpp +++ b/src/sls.cpp @@ -397,6 +397,9 @@ bool SLSManager::encodeFile(const std::string& fname, int fidx, bool raw_slides) fname.c_str(), fidx, blobsize); } resize_required = false; + } else { + free(blob); + blob = NULL; } } -- cgit v1.2.3