From bfee21b8769469437e1cbcb8f84ff4bc4235f546 Mon Sep 17 00:00:00 2001 From: ashutoshharry Date: Fri, 23 Jan 2026 08:12:39 -0500 Subject: [PATCH 1/3] Update curlinterface.c --- source/protocol/http/curlinterface.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/source/protocol/http/curlinterface.c b/source/protocol/http/curlinterface.c index b16aca49..c6be8464 100644 --- a/source/protocol/http/curlinterface.c +++ b/source/protocol/http/curlinterface.c @@ -281,19 +281,6 @@ static void curlCertSelectorInit() T2Info("%s, T2:Cert selector initialization successfully\n", __func__); } } - else - { - curlCertSelectorFree (); - curlCertSelector = rdkcertselector_new( NULL, NULL, "MTLS" ); - if(curlCertSelector == NULL) - { - T2Error("%s, T2:Cert selector initialization failed\n", __func__); - } - else - { - T2Info("%s, T2:Cert selector initialization successfully\n", __func__); - } - } } #endif T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) @@ -471,10 +458,13 @@ T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) } #endif if (pCertPC == NULL) - T2Error("%s : passcode is NULL\n",__func__); + T2Info("%s : passcode is NULL\n",__func__); + else + T2Info("%s: pCertPC size = %d\n",__func__,strlen(pCertPC)); + if (pCertURI == NULL) - T2Error("%s : cert URI is NULL\n",__func__); - T2Info("%s: pCertPC size = %d\n",__func__,sizeof(pCertPC)); + T2Info("%s : cert URI is NULL\n",__func__); + if((mtls_enable == true) && (setMtlsHeaders(curl, pCertFile, pCertPC, &childCurlResponse) != T2ERROR_SUCCESS)) { curl_easy_cleanup(curl); // CID 189985: Resource leak @@ -527,6 +517,7 @@ T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) } child_cleanReturn : + curlCertSelectorFree (); if (headerList){ curl_slist_free_all(headerList); } From aca79809b35487bf2f7bb47eb88c0965a1ca52c1 Mon Sep 17 00:00:00 2001 From: ashutoshharry Date: Fri, 23 Jan 2026 12:54:20 -0500 Subject: [PATCH 2/3] Update curlinterface.c --- source/protocol/http/curlinterface.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/protocol/http/curlinterface.c b/source/protocol/http/curlinterface.c index c6be8464..c03990ce 100644 --- a/source/protocol/http/curlinterface.c +++ b/source/protocol/http/curlinterface.c @@ -281,6 +281,20 @@ static void curlCertSelectorInit() T2Info("%s, T2:Cert selector initialization successfully\n", __func__); } } + else + { + curlCertSelectorFree (); + curlCertSelector = rdkcertselector_new( NULL, NULL, "MTLS" ); + if(curlCertSelector == NULL) + { + T2Error("%s, T2:Cert selector initialization failed\n", __func__); + } + else + { + T2Info("%s, T2:Cert selector initialization successfully\n", __func__); + } + + } } #endif T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) @@ -444,7 +458,7 @@ T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) if(curlGetCertStatus != certselectorOk) { T2Error("%s, T2:Failed to retrieve the certificate.\n", __func__); - curlCertSelectorFree(); + (); curl_easy_cleanup(curl); goto child_cleanReturn; } @@ -517,7 +531,6 @@ T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) } child_cleanReturn : - curlCertSelectorFree (); if (headerList){ curl_slist_free_all(headerList); } From a94d62ecafde513dd75eef8ef7d2a8afffd7664d Mon Sep 17 00:00:00 2001 From: ashutoshharry Date: Fri, 23 Jan 2026 13:54:23 -0500 Subject: [PATCH 3/3] Update curlinterface.c --- source/protocol/http/curlinterface.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/protocol/http/curlinterface.c b/source/protocol/http/curlinterface.c index c03990ce..f5ae2d5f 100644 --- a/source/protocol/http/curlinterface.c +++ b/source/protocol/http/curlinterface.c @@ -458,7 +458,6 @@ T2ERROR sendReportOverHTTP(char *httpUrl, char *payload, pid_t* outForkedPid) if(curlGetCertStatus != certselectorOk) { T2Error("%s, T2:Failed to retrieve the certificate.\n", __func__); - (); curl_easy_cleanup(curl); goto child_cleanReturn; }