Closed sago007 closed 6 years ago
Thanks! Yeah, I can see why it'd complain. Can you move the if
before the while
? Then I'll happily merge it.
I have moved the check and removed it from the while loop. I had originally placed it after the while-loop in case it could be nulled inside the loop. I realize now that it would be impossible without another UB inside the loop.
Great! Thanks for helping out!
The line
Will cause undefined behaviour if "node" is NULL. However right before it was a while loop like this:
Indicating that "node" could be NULL. This caused Codacy to complain.
This pull requests adds a NULL check that will prevent the program from reaching the code that would trigger an undefined behaviour.