talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 4cb31b49abd02e934a8da0842cafc076fa0f4849
parent b007c1233c5f08639e9552077a5e26823f7b5ae6
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Thu, 25 Apr 2019 22:40:31 +0200

Fix a memory leak in litehtml plugin's container_linux::load_image()

Diffstat:
Msrc/plugins/litehtml_viewer/container_linux_images.cpp | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/plugins/litehtml_viewer/container_linux_images.cpp b/src/plugins/litehtml_viewer/container_linux_images.cpp @@ -109,7 +109,7 @@ void container_linux::load_image( const litehtml::tchar_t* src, const litehtml:: unlock_images_cache(); if (!found) { - struct FetchCtx *ctx = g_new(struct FetchCtx, 1); + struct FetchCtx *ctx; /* Attached images can be loaded into cache right here. */ if (!strncmp(src, "cid:", 4)) { @@ -128,6 +128,7 @@ void container_linux::load_image( const litehtml::tchar_t* src, const litehtml:: debug_print("allowing download of image from '%s'\n", src); + ctx = g_new(struct FetchCtx, 1); ctx->url = g_strdup(url.c_str()); ctx->container = this;