Skip to content

Static analyzer (PVS Studio) fixes #1372

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

Merged
merged 7 commits into from
Mar 31, 2020
Merged

Static analyzer (PVS Studio) fixes #1372

merged 7 commits into from
Mar 31, 2020

Conversation

dimhotepus
Copy link
Contributor

@dimhotepus dimhotepus commented Mar 27, 2020

Some fixes from PVS Studio static analyzer.

Product page: https://www.viva64.com/en/pvs-studio/
How to use for free: https://www.viva64.com/en/b/0600/

Thanks for SDK, used that in own projects.

Should call delete on pointer instead of releasing it to the caller.
Enclose macro args in round brackets to ensure operators priority.
* Delete of void pointer is UB.  See section 5.3.5/3.  SO question:
https://stackoverflow.com/questions/941832/is-it-safe-to-delete-a-void-pointer
* Windows APIs used here return FALSE in case of failure, and
non-FALSE on success.  There is no info in spec that only TRUE
value indicates success.  Correct way to implement check for
success call is to compare with false like result != FALSE.
Ensure + or - sign is used for time zone offset in RFC1123 military
time format.
@dimhotepus
Copy link
Contributor Author

Build is broken due to artifacts to upload limit and name resolution failure.

failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘www.openssl.org’
make: *** [openssl-1.1.0j.tar.gz] Error 4
Makefile:110: recipe for target 'openssl-1.1.0j.tar.gz' failed

##[error]Bash exited with code '1'.

@BillyONeal BillyONeal merged commit 927afad into microsoft:master Mar 31, 2020
@BillyONeal
Copy link
Member

Thanks for your contribution!

@dimhotepus dimhotepus deleted the pvs_studio_fixes branch April 12, 2020 18:11
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