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
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private static Properties getProperties(ClassLoader parent, String propsFileName

props.load(in);
LOG.fine("Contents: " + propsFileName + props);

in.close();
return props;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
pad, org_apache_cxf_pad_string_PAD_LEFT);
return (org_apache_cxf_pad_string(Math.ceil(len / 2) + string.length,
pad, org_apache_cxf_pad_string_PAD_RIGHT));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

return type.cast(response);

} catch (JAXBException e) {
handleJAXBException(e, true);
} catch (XMLStreamException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,8 @@ protected void verifyTable(Connection con, String tableName, String[][] tableCol
while (rs.next()) {
dbCols.add(rs.getString(4));
}
rs.close();

for (String[] col : tableCols) {
if (!dbCols.contains(col[0])) {
newCols.add(col);
Expand Down
Loading