martinzink commented on PR #1471: URL: https://github.com/apache/nifi-minifi-cpp/pull/1471#issuecomment-1346665510
Awesome find :pray: thanks for digging this out. Could you please add the explanation here or in the Jira how this could cause a memory leak? Also adding a unit test like this somewhere could make it easier for reviewrs to verify the leak and the PR (resolving the [well-known SID-s](https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers#well-known-sids) leak 3 bytes of memory before your PR and 0 after that :+1: ) > #ifdef WIN32 TEST_CASE("Check userIdToUsername for memory leak", "[OsUtilTests]") { minifi::utils::OsUtils::userIdToUsername("S-1-0-0"); minifi::utils::OsUtils::userIdToUsername("S-1-1-0"); minifi::utils::OsUtils::userIdToUsername("S-1-2-0"); minifi::utils::OsUtils::userIdToUsername("S-1-2-1"); minifi::utils::OsUtils::userIdToUsername("S-1-3-0"); minifi::utils::OsUtils::userIdToUsername("S-1-3-1"); minifi::utils::OsUtils::userIdToUsername("S-1-3-2"); minifi::utils::OsUtils::userIdToUsername("S-1-3-3"); minifi::utils::OsUtils::userIdToUsername("S-1-3-4"); minifi::utils::OsUtils::userIdToUsername("S-1-4"); minifi::utils::OsUtils::userIdToUsername("S-1-5"); minifi::utils::OsUtils::userIdToUsername("S-1-5-80-0"); } #endif -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
