Rule cpp:S836 reports a bug without a reason


I’m new to the community and the tool, and probably not getting the things right,
but after several similar cases, I finally decided to ask someone.

here I have this code

The bug report is not completely unreasonable, as LoadIcon() may return NULL,
but the message that is shown is definitely not correct. How can hIcon this be an uninitialized value ?

I’m using SonarCube 9.6.1 (build 59531)

Hey there.

Welcome to our Community! I’ve moved your post to the section for reporting false-postives.

Please update your thread with a text-based code sample that reproduces the issue (not a screenshot)