Skip to content
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

CXF-9107 Clean up coverity resource leaks and a javascript method typo #2253

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cunningt
Copy link
Contributor

@cunningt cunningt commented Feb 3, 2025

https://issues.apache.org/jira/browse/CXF-9107

Clean up coverity resource leaks (inputstream and resultset) and a javascript method typo

@@ -540,7 +540,7 @@ function org_apache_cxf_pad_string(string, len, pad, type) {
pad = typeof(pad) == 'string' ? pad : ' ';

if (type == org_apache_cxf_pad_string_PAD_BOTH) {
string = org_apache_cxf_pad_sring(Math.floor(len / 2) + string.length,
string = org_apache_cxf_pad_string(Math.floor(len / 2) + string.length,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -239,8 +239,8 @@ public T readFrom(Class<T> type, Type genericType, Annotation[] anns, MediaType
} else {
response = checkAdapter(response, type, anns, false);
}
realStream.close();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this may not work: the stream is not created here and should not be closed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this within a try-with-resources?

Copy link
Member

@reta reta Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure it is being done this way (higher in the stack), when the request / response body is being processed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants