Skip to content

Commit 9e1a8d7

Browse files
authored
Merge pull request #3572 from matt335672/cppcheck_2_18
Update to cppcheck 2.18.3
2 parents 854d948 + b8e7c6e commit 9e1a8d7

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
CC: gcc
182182
# This is required to use a version of cppcheck other than that
183183
# supplied with the operating system
184-
CPPCHECK_VER: "2.17.1"
184+
CPPCHECK_VER: "2.18.3"
185185
CPPCHECK_REPO: https://github.com/danmar/cppcheck.git
186186
steps:
187187
# Set steps.os.outputs.image to the specific OS (e.g. 'ubuntu20')

scripts/run_cppcheck.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ if [ -z "$CPPCHECK_FLAGS" ]; then
8686
CPPCHECK_FLAGS="--quiet --force --std=c11 --std=c++11 --inline-suppr \
8787
--enable=warning --error-exitcode=1 -i third_party \
8888
--suppress=uninitMemberVar:ulalaca/ulalaca.cpp \
89+
--suppress=dangerousTypeCast:ulalaca/XrdpStream.template.cpp \
8990
--suppress=shiftTooManyBits:libxrdp/xrdp_mppc_enc.c"
9091

9192
# Check for flags added in later versions

xrdp/xrdp_tconfig.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type,
225225
datum.u.s,
226226
sizeof(param[connection_type].preset) - 1);
227227
free(datum.u.s);
228+
datum.u.s = NULL;
228229
}
229230
else if (connection_type == 0)
230231
{
@@ -245,6 +246,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type,
245246
datum.u.s,
246247
sizeof(param[connection_type].tune) - 1);
247248
free(datum.u.s);
249+
datum.u.s = NULL;
248250
}
249251
else if (connection_type == 0)
250252
{
@@ -265,6 +267,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type,
265267
datum.u.s,
266268
sizeof(param[connection_type].profile) - 1);
267269
free(datum.u.s);
270+
datum.u.s = NULL; // Prevent double-free warning with cppcheck 2.18.0
268271
}
269272
else if (connection_type == 0)
270273
{

0 commit comments

Comments
 (0)