Skip to content

Handle Coverity issues - #12210

Merged
Nir-Az merged 1 commit into
realsenseai:developmentfrom
OhadMeir:Coverity
Sep 19, 2023
Merged

Nir-Az merged 1 commit into
realsenseai:developmentfrom
OhadMeir:Coverity

Conversation

@OhadMeir

Copy link
Copy Markdown
Contributor

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

@OhadMeir
OhadMeir requested review from Nir-Az and Tamir91 September 19, 2023 08:13
{
preset old_preset_values;
rs2_rs400_visual_preset old_preset;
preset old_preset_values{};

Copy link
Copy Markdown
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
Copy Markdown
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 realsenseai: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