Skip to content

Commit

Permalink
Fixed several issues reported by PVS Studio static analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
sadko4u committed Sep 3, 2023
1 parent c6d363a commit cbc986e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*******************************************************************************

=== 1.0.31 ===
* Fixed several issues reported by PVS Studio static analyzer.
* Added release_ptr() template method for releasing pointers that should be freed by finally statement.

=== 1.0.30 ===
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ It provides:
* Macros for architecture-dependent assembly code and compilation.
* Error codes and functions to work with them.

Supported platforms
======
## Supported platforms

The build and correct unit test execution has been confirmed for following platforms:
* FreeBSD
Expand All @@ -19,16 +18,14 @@ The build and correct unit test execution has been confirmed for following platf
* Windows 32-bit
* Windows 64-bit

Requirements
======
## Requirements

The following packages need to be installed for building:

* gcc >= 4.9
* make >= 4.0

Building
======
## Building

To build the library, perform the following commands:

Expand Down Expand Up @@ -62,3 +59,7 @@ To clean the whole project tree including configuration files, run:
```bash
make prune
```

## SAST Tools

* [PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
10 changes: 8 additions & 2 deletions src/main/debug.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2020 Vladimir Sadovnikov <[email protected]>
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
* (C) 2023 Vladimir Sadovnikov <[email protected]>
*
* This file is part of lsp-common-lib
* Created on: 7 апр. 2020 г.
Expand Down Expand Up @@ -357,6 +357,9 @@ namespace lsp

log_string & log_string::operator = (const log_string & src)
{
if (this == &src)
return *this;

if (text != NULL)
free(text);
text = (src.text != NULL) ? strdup(src.text) : NULL;
Expand All @@ -365,6 +368,9 @@ namespace lsp

log_string & log_string::operator = (log_string && src)
{
if (this == &src)
return *this;

if (text != NULL)
free(text);
text = src.text;
Expand Down

0 comments on commit cbc986e

Please sign in to comment.