Skip to content

Commit 4ef531e

Browse files
committed
Fix curl related memory leak
Direct leak of 21280 byte(s) in 4 object(s) allocated from: rofafor#2 0x7fe58e0fdac0 in curl_easy_init (/usr/local/lib64/libcurl.so.4+0x1dac0) rofafor#3 0x7fe58c763576 in cIptvProtocolCurl::Connect() iptv-2.4.0/protocolcurl.c:284 rofafor#4 0x7fe58c76a180 in cIptvProtocolCurl::cIptvProtocolCurl() iptv-2.4.0/protocolcurl.c:47 rofafor#5 0x7fe58c751950 in cIptvDevice::cIptvDevice(unsigned int) iptv-2.4.0/device.c:36 rofafor#6 0x7fe58c7539bb in cIptvDevice::Initialize(unsigned int) iptv-2.4.0/device.c:88 rofafor#7 0xa73380 in cPluginManager::InitializePlugins() vdr-2.4.7/plugin.c:375 rofafor#8 0x4e2eff in main vdr-2.4.7/vdr.c:833
1 parent 2040edb commit 4ef531e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

protocolcurl.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,10 @@ bool cIptvProtocolCurl::Connect()
280280
return true;
281281

282282
// Initialize the curl session
283-
if (!handleM)
283+
if (!handleM) {
284284
handleM = curl_easy_init();
285+
connectedM = true;
286+
}
285287

286288
if (handleM && !isempty(*streamUrlM)) {
287289
CURLcode res = CURLE_OK;
@@ -428,7 +430,6 @@ bool cIptvProtocolCurl::Connect()
428430
}
429431

430432
timeoutM.Set(eKeepAliveIntervalMs);
431-
connectedM = true;
432433
return true;
433434
}
434435

0 commit comments

Comments
 (0)