From 4ef531e6379ab30dadb6026cdd015a1c66b70744 Mon Sep 17 00:00:00 2001 From: repojohnray <8113421+repojohnray@users.noreply.github.com> Date: Fri, 13 Jan 2023 01:45:41 +0100 Subject: [PATCH] Fix curl related memory leak Direct leak of 21280 byte(s) in 4 object(s) allocated from: #2 0x7fe58e0fdac0 in curl_easy_init (/usr/local/lib64/libcurl.so.4+0x1dac0) #3 0x7fe58c763576 in cIptvProtocolCurl::Connect() iptv-2.4.0/protocolcurl.c:284 #4 0x7fe58c76a180 in cIptvProtocolCurl::cIptvProtocolCurl() iptv-2.4.0/protocolcurl.c:47 #5 0x7fe58c751950 in cIptvDevice::cIptvDevice(unsigned int) iptv-2.4.0/device.c:36 #6 0x7fe58c7539bb in cIptvDevice::Initialize(unsigned int) iptv-2.4.0/device.c:88 #7 0xa73380 in cPluginManager::InitializePlugins() vdr-2.4.7/plugin.c:375 #8 0x4e2eff in main vdr-2.4.7/vdr.c:833 --- protocolcurl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocolcurl.c b/protocolcurl.c index d286218..6356e71 100644 --- a/protocolcurl.c +++ b/protocolcurl.c @@ -280,8 +280,10 @@ bool cIptvProtocolCurl::Connect() return true; // Initialize the curl session - if (!handleM) + if (!handleM) { handleM = curl_easy_init(); + connectedM = true; + } if (handleM && !isempty(*streamUrlM)) { CURLcode res = CURLE_OK; @@ -428,7 +430,6 @@ bool cIptvProtocolCurl::Connect() } timeoutM.Set(eKeepAliveIntervalMs); - connectedM = true; return true; }