-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential system resource/memory leaks #6461
Comments
Thanks for the report. |
to follow up ##potenial memory leak The same time log print from UaExpert as followed: The log in bold memory leak happens. |
detected at 1.3.9 or before
socket handle failed to close
line 1367, file ua_client_connect.c, the call to UA_SecureChannel_close might miss the call to close the socket handle when the SecureChannel was not attached. I added the following codes before the call seems to be able to work around this issue.
...
if(!client->channel.connection) {
if(client->connection.close)
client->connection.close(&client->connection);
}
UA_SecureChannel_close(&client->channel);
...
potenial memory leak
line 118, file ua_accesscontrol_default.c, I detected the 'username' not always be clear. It seems to be caused by reconnect, I will enclose more details soon, it hard to reproduce, it sometimes takes days or weeks.
UA_ByteString *username = UA_ByteString_new();
if(username)
UA_ByteString_copy(&userToken->userName, username);
*sessionContext = username;
dangled logger
line 41, file ua_client_connect.c, it seems to that the logger requires to update or it will cause memory access violation.
static UA_SecurityPolicy *
getSecurityPolicy(UA_Client *client, UA_String policyUri) {
for(size_t i = 0; i < client->config.securityPoliciesSize; i++) {
if(UA_String_equal(&policyUri, &client->config.securityPolicies[i].policyUri)) {
UA_SecurityPolicy *sp = &client->config.securityPolicies[i];
sp->logger = &client->config.logger;
return sp;
}
}
return NULL;
}
Used CMake options:
Checklist
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: