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

Handle Coverity issues #12210

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Handle Coverity issues #12210

merged 1 commit into from
Sep 19, 2023

Conversation

OhadMeir
Copy link
Contributor

Handle Coverity issues:
6053336 potential resource leak (unclosed file).
3413301, 3413347, 3413536, 3413541 dealing with potentially uninitialized variables.

@OhadMeir OhadMeir requested review from Tamir91 and Nir-Az September 19, 2023 08:13
@@ -1552,8 +1552,8 @@ namespace librealsense

std::shared_ptr<ds_advanced_mode_base> auto_calibrated::change_preset()
{
preset old_preset_values;
rs2_rs400_visual_preset old_preset;
preset old_preset_values{};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you remind me the effect of it?
Without it , it will also call the default Ctor no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think that this is a real issue, but I preferred to add this and not mark the issue as "not a bug" as I was already changing other issues in this file.

Reading the documentation, this issue is very confusing and have cyclic definitions. As I understand, preset is a struct so it will be "aggregate initialized". Each of its inner structs will be also "aggregate initialized" and the inner most fields "value initialized". Since they are native types they all should be initialized to static_cast( 0 ).

@Nir-Az Nir-Az merged commit ff38a3f into IntelRealSense:development Sep 19, 2023
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