Task #91755 - fixed.err
back to task #91755download
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18beta1/postgresql-17.2/src/backend/access/gist/gistutil.c:206: error[uninitvar]: Uninitialized variable: &attrsize
# 204| giststate->supportCollation[i],
# 205| PointerGetDatum(evec),
# 206|-> PointerGetDatum(&attrsize));
# 207|
# 208| isnull[i] = false;
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18beta1/postgresql-17.2/src/backend/access/gist/gistutil.c:275: error[uninitvar]: Uninitialized variable: &dstsize
# 273| giststate->supportCollation[attno],
# 274| PointerGetDatum(evec),
# 275|-> PointerGetDatum(&dstsize));
# 276| }
# 277| }
Error: COMPILER_WARNING (CWE-457):
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c: scope_hint: In function ‘compareJsonbContainers’
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c:294:34: warning[-Wmaybe-uninitialized]: ‘va.type’ may be used uninitialized
# 294 | res = (va.type > vb.type) ? 1 : -1;
# | ~~^~~~~
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c:202:33: note: ‘va’ declared here
# 202 | JsonbValue va,
# | ^~
# 292| Assert(vb.type != jbvBinary);
# 293| /* Type-defined order */
# 294|-> res = (va.type > vb.type) ? 1 : -1;
# 295| }
# 296| }
Error: COMPILER_WARNING (CWE-457):
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c:294:44: warning[-Wmaybe-uninitialized]: ‘vb.type’ may be used uninitialized
# 294 | res = (va.type > vb.type) ? 1 : -1;
# | ~~^~~~~
postgresql-18beta1/postgresql-17.2/src/backend/utils/adt/jsonb_util.c:203:41: note: ‘vb’ declared here
# 203 | vb;
# | ^~
# 292| Assert(vb.type != jbvBinary);
# 293| /* Type-defined order */
# 294|-> res = (va.type > vb.type) ? 1 : -1;
# 295| }
# 296| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:730:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:717:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:718:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:718:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:721:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:727:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_lz4.c:730:1: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 728|
# 729| return true;
# 730|-> }
# 731|
# 732| static bool
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: throw: if ‘pg_malloc0’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 479| return false;
# 480|
# 481|-> zstdcs = (ZstdCompressorState *) pg_malloc0(sizeof(*zstdcs));
# 482| CFH->private_data = zstdcs;
# 483| zstdcs->fp = fp;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:474:22: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:474:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: throw: if ‘pg_malloc0’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 479| return false;
# 480|
# 481|-> zstdcs = (ZstdCompressorState *) pg_malloc0(sizeof(*zstdcs));
# 482| CFH->private_data = zstdcs;
# 483| zstdcs->fp = fp;
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: throw: if ‘ZSTD_DStreamInSize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 485| if (mode[0] == 'r')
# 486| {
# 487|-> zstdcs->input.src = pg_malloc0(ZSTD_DStreamInSize());
# 488| zstdcs->dstream = ZSTD_createDStream();
# 489| if (zstdcs->dstream == NULL)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: throw: if ‘ZSTD_DStreamInSize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:487:37: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 485| if (mode[0] == 'r')
# 486| {
# 487|-> zstdcs->input.src = pg_malloc0(ZSTD_DStreamInSize());
# 488| zstdcs->dstream = ZSTD_createDStream();
# 489| if (zstdcs->dstream == NULL)
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: throw: if ‘ZSTD_CStreamOutSize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 492| else if (mode[0] == 'w' || mode[0] == 'a')
# 493| {
# 494|-> zstdcs->output.size = ZSTD_CStreamOutSize();
# 495| zstdcs->output.dst = pg_malloc0(zstdcs->output.size);
# 496| zstdcs->cstream = _ZstdCStreamParams(CFH->compression_spec);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:17: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: throw: if ‘ZSTD_CStreamOutSize’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:494:39: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 492| else if (mode[0] == 'w' || mode[0] == 'a')
# 493| {
# 494|-> zstdcs->output.size = ZSTD_CStreamOutSize();
# 495| zstdcs->output.dst = pg_malloc0(zstdcs->output.size);
# 496| zstdcs->cstream = _ZstdCStreamParams(CFH->compression_spec);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_resource: opened here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:17: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 499| }
# 500| else
# 501|-> pg_fatal("unhandled mode \"%s\"", mode);
# 502|
# 503| return true;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:473:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:476:22: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:478:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:481:42: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:485:12: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:18: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:492:17: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/bin/pg_dump/compress_zstd.c:501:17: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 499| }
# 500| else
# 501|-> pg_fatal("unhandled mode \"%s\"", mode);
# 502|
# 503| return true;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:121:21: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:81:15: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:82:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:84:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:121:21: throw: if ‘pg_cryptohash_create’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:121:21: danger: ‘ctx’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 119| }
# 120|
# 121|-> ctx->hash = pg_cryptohash_create(type);
# 122| if (ctx->hash == NULL)
# 123| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:171:28: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:171:28: throw: if ‘pg_cryptohash_create’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:171:28: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 169| memset(shrinkbuf, 0, digest_size);
# 170|
# 171|-> hash_ctx = pg_cryptohash_create(ctx->type);
# 172| if (hash_ctx == NULL)
# 173| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: throw: if ‘pg_cryptohash_init’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 177| }
# 178|
# 179|-> if (pg_cryptohash_init(hash_ctx) < 0 ||
# 180| pg_cryptohash_update(hash_ctx, key, len) < 0 ||
# 181| pg_cryptohash_final(hash_ctx, shrinkbuf, digest_size) < 0)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: throw: if ‘pg_cryptohash_update’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 178|
# 179| if (pg_cryptohash_init(hash_ctx) < 0 ||
# 180|-> pg_cryptohash_update(hash_ctx, key, len) < 0 ||
# 181| pg_cryptohash_final(hash_ctx, shrinkbuf, digest_size) < 0)
# 182| {
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:181:25: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:180:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:181:25: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:181:25: throw: if ‘pg_cryptohash_final’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:181:25: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 179| if (pg_cryptohash_init(hash_ctx) < 0 ||
# 180| pg_cryptohash_update(hash_ctx, key, len) < 0 ||
# 181|-> pg_cryptohash_final(hash_ctx, shrinkbuf, digest_size) < 0)
# 182| {
# 183| ctx->error = PG_HMAC_ERROR_INTERNAL;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:184:42: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:184:42: throw: if ‘pg_cryptohash_error’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:184:42: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 182| {
# 183| ctx->error = PG_HMAC_ERROR_INTERNAL;
# 184|-> ctx->errreason = pg_cryptohash_error(hash_ctx);
# 185| pg_cryptohash_free(hash_ctx);
# 186| FREE(shrinkbuf);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:185:25: warning[-Wanalyzer-malloc-leak]: leak of ‘shrinkbuf’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:145:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:148:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:158:12: branch_true: following ‘true’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: branch_true: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:163:29: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:164:20: branch_false: following ‘false’ branch (when ‘shrinkbuf’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:169:17: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:172:20: branch_false: following ‘false’ branch...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:179:21: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:185:25: throw: if ‘pg_cryptohash_free’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:185:25: danger: ‘shrinkbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 183| ctx->error = PG_HMAC_ERROR_INTERNAL;
# 184| ctx->errreason = pg_cryptohash_error(hash_ctx);
# 185|-> pg_cryptohash_free(hash_ctx);
# 186| FREE(shrinkbuf);
# 187| return -1;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:259:13: warning[-Wanalyzer-malloc-leak]: leak of ‘h’
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:248:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:251:13: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:251:13: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:252:12: branch_false: following ‘false’ branch (when ‘h’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:257:9: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:259:13: throw: if ‘pg_cryptohash_final’ throws an exception...
postgresql-18beta1/postgresql-17.2/src/common/hmac.c:259:13: danger: ‘h’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 257| memset(h, 0, ctx->digest_size);
# 258|
# 259|-> if (pg_cryptohash_final(ctx->hash, h, ctx->digest_size) < 0)
# 260| {
# 261| ctx->error = PG_HMAC_ERROR_INTERNAL;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2312:29: warning[-Wanalyzer-malloc-leak]: leak of ‘startpacket’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2237:1: enter_function: entry to ‘pqBuildStartupPacket3’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2242:22: call_function: calling ‘build_startup_packet’ from ‘pqBuildStartupPacket3’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2242:22: return_function: returning to ‘pqBuildStartupPacket3’ from ‘build_startup_packet’
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2243:32: acquire_memory: allocated here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2244:12: branch_false: following ‘false’ branch (when ‘startpacket’ is non-NULL)...
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2246:22: branch_false: ...to here
postgresql-18beta1/postgresql-17.2/src/interfaces/libpq/fe-protocol3.c:2246:22: call_function: calling ‘build_startup_packet’ from ‘pqBuildStartupPacket3’
# 2310| if ((val = getenv(next_eo->envName)) != NULL)
# 2311| {
# 2312|-> if (pg_strcasecmp(val, "default") != 0)
# 2313| ADD_STARTUP_OPTION(next_eo->pgName, val);
# 2314| }
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18beta1/src/backend/access/gist/gistutil.c:207: error[uninitvar]: Uninitialized variable: &attrsize
# 205| giststate->supportCollation[i],
# 206| PointerGetDatum(evec),
# 207|-> PointerGetDatum(&attrsize));
# 208|
# 209| isnull[i] = false;
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18beta1/src/backend/access/gist/gistutil.c:276: error[uninitvar]: Uninitialized variable: &dstsize
# 274| giststate->supportCollation[attno],
# 275| PointerGetDatum(evec),
# 276|-> PointerGetDatum(&dstsize));
# 277| }
# 278| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:307:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:627:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 305| (pg_char_properties[c] & PG_ISDIGIT));
# 306| case PG_REGEX_STRATEGY_BUILTIN:
# 307|-> return pg_u_isdigit(c, !pg_regex_locale->info.builtin.casemap_full);
# 308| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 309| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:307:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:627:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 305| (pg_char_properties[c] & PG_ISDIGIT));
# 306| case PG_REGEX_STRATEGY_BUILTIN:
# 307|-> return pg_u_isdigit(c, !pg_regex_locale->info.builtin.casemap_full);
# 308| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 309| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:334:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:603:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 332| (pg_char_properties[c] & PG_ISALPHA));
# 333| case PG_REGEX_STRATEGY_BUILTIN:
# 334|-> return pg_u_isalpha(c);
# 335| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 336| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:334:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:603:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 332| (pg_char_properties[c] & PG_ISALPHA));
# 333| case PG_REGEX_STRATEGY_BUILTIN:
# 334|-> return pg_u_isalpha(c);
# 335| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 336| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:361:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:600:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 359| (pg_char_properties[c] & PG_ISALNUM));
# 360| case PG_REGEX_STRATEGY_BUILTIN:
# 361|-> return pg_u_isalnum(c, !pg_regex_locale->info.builtin.casemap_full);
# 362| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 363| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:361:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:600:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 359| (pg_char_properties[c] & PG_ISALNUM));
# 360| case PG_REGEX_STRATEGY_BUILTIN:
# 361|-> return pg_u_isalnum(c, !pg_regex_locale->info.builtin.casemap_full);
# 362| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 363| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:397:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:654:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 395| (pg_char_properties[c] & PG_ISUPPER));
# 396| case PG_REGEX_STRATEGY_BUILTIN:
# 397|-> return pg_u_isupper(c);
# 398| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 399| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:397:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:654:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 395| (pg_char_properties[c] & PG_ISUPPER));
# 396| case PG_REGEX_STRATEGY_BUILTIN:
# 397|-> return pg_u_isupper(c);
# 398| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 399| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:424:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:651:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 422| (pg_char_properties[c] & PG_ISLOWER));
# 423| case PG_REGEX_STRATEGY_BUILTIN:
# 424|-> return pg_u_islower(c);
# 425| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 426| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:424:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:651:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 422| (pg_char_properties[c] & PG_ISLOWER));
# 423| case PG_REGEX_STRATEGY_BUILTIN:
# 424|-> return pg_u_islower(c);
# 425| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 426| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:451:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:657:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 449| (pg_char_properties[c] & PG_ISGRAPH));
# 450| case PG_REGEX_STRATEGY_BUILTIN:
# 451|-> return pg_u_isgraph(c);
# 452| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 453| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:451:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:657:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 449| (pg_char_properties[c] & PG_ISGRAPH));
# 450| case PG_REGEX_STRATEGY_BUILTIN:
# 451|-> return pg_u_isgraph(c);
# 452| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 453| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:478:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:597:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 476| (pg_char_properties[c] & PG_ISPRINT));
# 477| case PG_REGEX_STRATEGY_BUILTIN:
# 478|-> return pg_u_isprint(c);
# 479| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 480| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:478:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:597:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 476| (pg_char_properties[c] & PG_ISPRINT));
# 477| case PG_REGEX_STRATEGY_BUILTIN:
# 478|-> return pg_u_isprint(c);
# 479| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 480| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:505:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:630:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 503| (pg_char_properties[c] & PG_ISPUNCT));
# 504| case PG_REGEX_STRATEGY_BUILTIN:
# 505|-> return pg_u_ispunct(c, !pg_regex_locale->info.builtin.casemap_full);
# 506| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 507| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:505:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:630:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 503| (pg_char_properties[c] & PG_ISPUNCT));
# 504| case PG_REGEX_STRATEGY_BUILTIN:
# 505|-> return pg_u_ispunct(c, !pg_regex_locale->info.builtin.casemap_full);
# 506| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 507| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:532:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:648:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 530| (pg_char_properties[c] & PG_ISSPACE));
# 531| case PG_REGEX_STRATEGY_BUILTIN:
# 532|-> return pg_u_isspace(c);
# 533| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 534| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/backend/regex/regc_pg_locale.c:532:32: warning[-Wanalyzer-malloc-leak]: leak of ‘pcc’
postgresql-18beta1/src/backend/regex/regc_locale.c:569:1: enter_function: entry to ‘cclasscvec’
postgresql-18beta1/src/backend/regex/regc_locale.c:648:30: call_function: calling ‘pg_ctype_get_cache’ from ‘cclasscvec’
# 530| (pg_char_properties[c] & PG_ISSPACE));
# 531| case PG_REGEX_STRATEGY_BUILTIN:
# 532|-> return pg_u_isspace(c);
# 533| case PG_REGEX_STRATEGY_LIBC_WIDE:
# 534| if (sizeof(wchar_t) >= 4 || c <= (pg_wchar) 0xFFFF)
Error: COMPILER_WARNING (CWE-457):
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c: scope_hint: In function ‘compareJsonbContainers’
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c:301:34: warning[-Wmaybe-uninitialized]: ‘va.type’ may be used uninitialized
# 301 | res = (va.type > vb.type) ? 1 : -1;
# | ~~^~~~~
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c:202:33: note: ‘va’ declared here
# 202 | JsonbValue va,
# | ^~
# 299| Assert(vb.type != jbvBinary);
# 300| /* Type-defined order */
# 301|-> res = (va.type > vb.type) ? 1 : -1;
# 302| }
# 303| }
Error: COMPILER_WARNING (CWE-457):
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c:301:44: warning[-Wmaybe-uninitialized]: ‘vb.type’ may be used uninitialized
# 301 | res = (va.type > vb.type) ? 1 : -1;
# | ~~^~~~~
postgresql-18beta1/src/backend/utils/adt/jsonb_util.c:203:41: note: ‘vb’ declared here
# 203 | vb;
# | ^~
# 299| Assert(vb.type != jbvBinary);
# 300| /* Type-defined order */
# 301|-> res = (va.type > vb.type) ? 1 : -1;
# 302| }
# 303| }
Error: GCC_ANALYZER_WARNING (CWE-457):
postgresql-18beta1/src/backend/utils/mmgr/mcxt.c:959:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*num_contexts’
postgresql-18beta1/src/backend/utils/mmgr/mcxt.c:860:1: enter_function: entry to ‘MemoryContextStatsDetail’
postgresql-18beta1/src/backend/utils/mmgr/mcxt.c:876:9: call_function: calling ‘MemoryContextStatsInternal’ from ‘MemoryContextStatsDetail’
# 957|
# 958| /* Increment the context count for each of the recursive call */
# 959|-> *num_contexts = *num_contexts + 1;
# 960|
# 961| /*
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:730:1: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:717:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:718:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:718:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:721:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:727:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_lz4.c:730:1: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 728|
# 729| return true;
# 730|-> }
# 731|
# 732| static bool
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: throw: if ‘pg_malloc0’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 481| return false;
# 482|
# 483|-> zstdcs = (ZstdCompressorState *) pg_malloc0(sizeof(*zstdcs));
# 484| CFH->private_data = zstdcs;
# 485| zstdcs->fp = fp;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_true: following ‘true’ branch (when ‘fd >= 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:476:22: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:476:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: throw: if ‘pg_malloc0’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 481| return false;
# 482|
# 483|-> zstdcs = (ZstdCompressorState *) pg_malloc0(sizeof(*zstdcs));
# 484| CFH->private_data = zstdcs;
# 485| zstdcs->fp = fp;
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: throw: if ‘ZSTD_DStreamInSize’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 487| if (mode[0] == 'r')
# 488| {
# 489|-> zstdcs->input.src = pg_malloc0(ZSTD_DStreamInSize());
# 490| zstdcs->dstream = ZSTD_createDStream();
# 491| if (zstdcs->dstream == NULL)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: throw: if ‘ZSTD_DStreamInSize’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:489:37: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
# 487| if (mode[0] == 'r')
# 488| {
# 489|-> zstdcs->input.src = pg_malloc0(ZSTD_DStreamInSize());
# 490| zstdcs->dstream = ZSTD_createDStream();
# 491| if (zstdcs->dstream == NULL)
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:17: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: throw: if ‘ZSTD_CStreamOutSize’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 494| else if (mode[0] == 'w' || mode[0] == 'a')
# 495| {
# 496|-> zstdcs->output.size = ZSTD_CStreamOutSize();
# 497| zstdcs->output.dst = pg_malloc0(zstdcs->output.size);
# 498| zstdcs->cstream = _ZstdCStreamParams(CFH->compression_spec);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:17: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: throw: if ‘ZSTD_CStreamOutSize’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:496:39: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 494| else if (mode[0] == 'w' || mode[0] == 'a')
# 495| {
# 496|-> zstdcs->output.size = ZSTD_CStreamOutSize();
# 497| zstdcs->output.dst = pg_malloc0(zstdcs->output.size);
# 498| zstdcs->cstream = _ZstdCStreamParams(CFH->compression_spec);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:17: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: danger: ‘fp’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 501| }
# 502| else
# 503|-> pg_fatal("unhandled mode \"%s\"", mode);
# 504|
# 505| return true;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:475:12: branch_false: following ‘false’ branch (when ‘fd < 0’)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:478:22: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:480:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:483:42: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:487:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:18: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:494:17: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/compress_zstd.c:503:17: danger: ‘fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 501| }
# 502| else
# 503|-> pg_fatal("unhandled mode \"%s\"", mode);
# 504|
# 505| return true;
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 1665| }
# 1666|
# 1667|-> for (i = 0; i < PQntuples(res); i++)
# 1668| {
# 1669| char *dbname = PQgetvalue(res, i, 0);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: throw: if ‘PQntuples’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:25: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 1665| }
# 1666|
# 1667|-> for (i = 0; i < PQntuples(res); i++)
# 1668| {
# 1669| char *dbname = PQgetvalue(res, i, 0);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 1667| for (i = 0; i < PQntuples(res); i++)
# 1668| {
# 1669|-> char *dbname = PQgetvalue(res, i, 0);
# 1670| char *oid = PQgetvalue(res, i, 1);
# 1671| const char *create_opts = "";
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 1667| for (i = 0; i < PQntuples(res); i++)
# 1668| {
# 1669|-> char *dbname = PQgetvalue(res, i, 0);
# 1670| char *oid = PQgetvalue(res, i, 1);
# 1671| const char *create_opts = "";
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 1668| {
# 1669| char *dbname = PQgetvalue(res, i, 0);
# 1670|-> char *oid = PQgetvalue(res, i, 1);
# 1671| const char *create_opts = "";
# 1672| int ret;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: throw: if ‘PQgetvalue’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1670:35: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 1668| {
# 1669| char *dbname = PQgetvalue(res, i, 0);
# 1670|-> char *oid = PQgetvalue(res, i, 1);
# 1671| const char *create_opts = "";
# 1672| int ret;
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: throw: if ‘simple_string_list_member’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 1677|
# 1678| /* Skip any explicitly excluded database */
# 1679|-> if (simple_string_list_member(&database_exclude_names, dbname))
# 1680| {
# 1681| pg_log_info("excluding database \"%s\"", dbname);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: throw: if ‘simple_string_list_member’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:21: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
# 1677|
# 1678| /* Skip any explicitly excluded database */
# 1679|-> if (simple_string_list_member(&database_exclude_names, dbname))
# 1680| {
# 1681| pg_log_info("excluding database \"%s\"", dbname);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
# 1679| if (simple_string_list_member(&database_exclude_names, dbname))
# 1680| {
# 1681|-> pg_log_info("excluding database \"%s\"", dbname);
# 1682| continue;
# 1683| }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: throw: if ‘pg_log_generic’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1681:25: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 1679| if (simple_string_list_member(&database_exclude_names, dbname))
# 1680| {
# 1681|-> pg_log_info("excluding database \"%s\"", dbname);
# 1682| continue;
# 1683| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: following ‘true’ branch (when ‘archDumpFormat == 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 1690| {
# 1691| if (archDumpFormat == archCustom)
# 1692|-> snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".dmp", db_subdir, oid);
# 1693| else if (archDumpFormat == archTar)
# 1694| snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: following ‘true’ branch (when ‘archDumpFormat == 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1692:33: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 1690| {
# 1691| if (archDumpFormat == archCustom)
# 1692|-> snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".dmp", db_subdir, oid);
# 1693| else if (archDumpFormat == archTar)
# 1694| snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_false: following ‘false’ branch (when ‘archDumpFormat != 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_true: following ‘true’ branch (when ‘archDumpFormat == 3’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 1692| snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".dmp", db_subdir, oid);
# 1693| else if (archDumpFormat == archTar)
# 1694|-> snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
# 1695| else
# 1696| snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\"", db_subdir, oid);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_false: following ‘false’ branch (when ‘archDumpFormat != 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_true: following ‘true’ branch (when ‘archDumpFormat == 3’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1694:33: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
# 1692| snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".dmp", db_subdir, oid);
# 1693| else if (archDumpFormat == archTar)
# 1694|-> snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
# 1695| else
# 1696| snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\"", db_subdir, oid);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_false: following ‘false’ branch (when ‘archDumpFormat != 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: following ‘false’ branch (when ‘archDumpFormat != 3’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
# 1694| snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
# 1695| else
# 1696|-> snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\"", db_subdir, oid);
# 1697|
# 1698| /* Put one line entry for dboid and dbname in map file. */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_false: following ‘false’ branch (when ‘archDumpFormat != 1’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1693:33: branch_false: following ‘false’ branch (when ‘archDumpFormat != 3’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: throw: if ‘pg_snprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1696:33: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
# 1694| snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\".tar", db_subdir, oid);
# 1695| else
# 1696|-> snprintf(dbfilepath, MAXPGPATH, "\"%s\"/\"%s\"", db_subdir, oid);
# 1697|
# 1698| /* Put one line entry for dboid and dbname in map file. */
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: danger: ‘map_file’ leaks here; was opened at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 1697|
# 1698| /* Put one line entry for dboid and dbname in map file. */
# 1699|-> fprintf(map_file, "%s %s\n", oid, dbname);
# 1700| }
# 1701|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: warning[-Wanalyzer-malloc-leak]: leak of ‘map_file’
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1641:12: branch_false: following ‘false’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1653:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1656:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1659:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1662:28: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1663:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1754:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1667:21: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1669:38: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1679:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1689:20: branch_true: following ‘true’ branch (when ‘archDumpFormat != 4’)...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1691:28: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: throw: if ‘pg_fprintf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1699:25: danger: ‘map_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
# 1697|
# 1698| /* Put one line entry for dboid and dbname in map file. */
# 1699|-> fprintf(map_file, "%s %s\n", oid, dbname);
# 1700| }
# 1701|
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18beta1/src/bin/pg_dump/pg_dumpall.c:1977: error[legacyUninitvar]: Uninitialized variable: archDumpFormat
# 1975| format);
# 1976|
# 1977|-> return archDumpFormat;
# 1978| }
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:869:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
# 867| StringInfoData q;
# 868|
# 869|-> initStringInfo(&q);
# 870|
# 871| resetStringInfo(inBuf);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:869:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
# 867| StringInfoData q;
# 868|
# 869|-> initStringInfo(&q);
# 870|
# 871| resetStringInfo(inBuf);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:871:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
# 869| initStringInfo(&q);
# 870|
# 871|-> resetStringInfo(inBuf);
# 872|
# 873| /*
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:871:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
# 869| initStringInfo(&q);
# 870|
# 871|-> resetStringInfo(inBuf);
# 872|
# 873| /*
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:876:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
# 874| * Read characters until EOF or the appropriate delimiter is seen.
# 875| */
# 876|-> while ((c = fgetc(pfile)) != EOF)
# 877| {
# 878| if (c != '\'' && c != '"' && c != '\n' && c != ';')
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:876:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
# 874| * Read characters until EOF or the appropriate delimiter is seen.
# 875| */
# 876|-> while ((c = fgetc(pfile)) != EOF)
# 877| {
# 878| if (c != '\'' && c != '"' && c != '\n' && c != ';')
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:878:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
# 876| while ((c = fgetc(pfile)) != EOF)
# 877| {
# 878|-> if (c != '\'' && c != '"' && c != '\n' && c != ';')
# 879| {
# 880| appendStringInfoChar(inBuf, (char) c);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:878:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1340:16: call_function: calling ‘read_one_statement’ from ‘process_global_sql_commands’
# 876| while ((c = fgetc(pfile)) != EOF)
# 877| {
# 878|-> if (c != '\'' && c != '"' && c != '\n' && c != ';')
# 879| {
# 880| appendStringInfoChar(inBuf, (char) c);
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&map_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1037:1: enter_function: entry to ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: call_function: calling ‘file_exists_in_directory’ from ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: return_function: returning to ‘get_dbname_oid_list_from_mfile’ from ‘file_exists_in_directory’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1055:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1058:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1060:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: danger: ‘fopen(&map_file_path, "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/8)
# 1061| pg_fatal("could not open \"%s\": %m", map_file_path);
# 1062|
# 1063|-> initStringInfo(&linebuf);
# 1064|
# 1065| /* Append all the dbname/db_oid combinations to the list. */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&map_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1037:1: enter_function: entry to ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: call_function: calling ‘file_exists_in_directory’ from ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: return_function: returning to ‘get_dbname_oid_list_from_mfile’ from ‘file_exists_in_directory’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1055:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1058:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1060:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: danger: ‘fopen(&map_file_path, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
# 1061| pg_fatal("could not open \"%s\": %m", map_file_path);
# 1062|
# 1063|-> initStringInfo(&linebuf);
# 1064|
# 1065| /* Append all the dbname/db_oid combinations to the list. */
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&map_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1037:1: enter_function: entry to ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: call_function: calling ‘file_exists_in_directory’ from ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: return_function: returning to ‘get_dbname_oid_list_from_mfile’ from ‘file_exists_in_directory’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1055:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1058:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1060:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: danger: ‘fopen(&map_file_path, "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/8)
# 1064|
# 1065| /* Append all the dbname/db_oid combinations to the list. */
# 1066|-> while (pg_get_line_buf(pfile, &linebuf))
# 1067| {
# 1068| Oid db_oid = InvalidOid;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&map_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1037:1: enter_function: entry to ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: call_function: calling ‘file_exists_in_directory’ from ‘get_dbname_oid_list_from_mfile’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:14: return_function: returning to ‘get_dbname_oid_list_from_mfile’ from ‘file_exists_in_directory’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1049:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1055:9: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1058:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1060:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1063:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: throw: if ‘pg_get_line_buf’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1066:16: danger: ‘fopen(&map_file_path, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/8)
# 1064|
# 1065| /* Append all the dbname/db_oid combinations to the list. */
# 1066|-> while (pg_get_line_buf(pfile, &linebuf))
# 1067| {
# 1068| Oid db_oid = InvalidOid;
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/0)
# 1328|
# 1329| /* Init sqlstatement to append commands. */
# 1330|-> initStringInfo(&sqlstatement);
# 1331|
# 1332| /* creation statement for our current role */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0)
# 1328|
# 1329| /* Init sqlstatement to append commands. */
# 1330|-> initStringInfo(&sqlstatement);
# 1331|
# 1332| /* creation statement for our current role */
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
# 1331|
# 1332| /* creation statement for our current role */
# 1333|-> initStringInfo(&user_create);
# 1334| appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335| /* should use fmtId here, but we don't know the encoding */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: throw: if ‘initStringInfo’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1333:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/0)
# 1331|
# 1332| /* creation statement for our current role */
# 1333|-> initStringInfo(&user_create);
# 1334| appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335| /* should use fmtId here, but we don't know the encoding */
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/0)
# 1332| /* creation statement for our current role */
# 1333| initStringInfo(&user_create);
# 1334|-> appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335| /* should use fmtId here, but we don't know the encoding */
# 1336| appendStringInfoString(&user_create, PQuser(conn));
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1334:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/0)
# 1332| /* creation statement for our current role */
# 1333| initStringInfo(&user_create);
# 1334|-> appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335| /* should use fmtId here, but we don't know the encoding */
# 1336| appendStringInfoString(&user_create, PQuser(conn));
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/0)
# 1334| appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335| /* should use fmtId here, but we don't know the encoding */
# 1336|-> appendStringInfoString(&user_create, PQuser(conn));
# 1337| appendStringInfoChar(&user_create, ';');
# 1338|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: throw: if ‘appendStringInfoString’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/0)
# 1334| appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335| /* should use fmtId here, but we don't know the encoding */
# 1336|-> appendStringInfoString(&user_create, PQuser(conn));
# 1337| appendStringInfoChar(&user_create, ';');
# 1338|
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: throw: if ‘PQuser’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/0)
# 1334| appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335| /* should use fmtId here, but we don't know the encoding */
# 1336|-> appendStringInfoString(&user_create, PQuser(conn));
# 1337| appendStringInfoChar(&user_create, ';');
# 1338|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: throw: if ‘PQuser’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1336:46: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/0)
# 1334| appendStringInfoString(&user_create, "CREATE ROLE ");
# 1335| /* should use fmtId here, but we don't know the encoding */
# 1336|-> appendStringInfoString(&user_create, PQuser(conn));
# 1337| appendStringInfoChar(&user_create, ';');
# 1338|
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: throw: if ‘appendStringInfoChar’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/0)
# 1335| /* should use fmtId here, but we don't know the encoding */
# 1336| appendStringInfoString(&user_create, PQuser(conn));
# 1337|-> appendStringInfoChar(&user_create, ';');
# 1338|
# 1339| /* Process file till EOF and execute sql statements. */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: following ‘false’ branch (when ‘outfile’ is NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1330:9: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: throw: if ‘appendStringInfoChar’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1337:9: danger: ‘fopen(&global_file_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/0)
# 1335| /* should use fmtId here, but we don't know the encoding */
# 1336| appendStringInfoString(&user_create, PQuser(conn));
# 1337|-> appendStringInfoChar(&user_create, ';');
# 1338|
# 1339| /* Process file till EOF and execute sql statements. */
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_true: following ‘true’ branch (when ‘outfile’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: call_function: calling ‘copy_or_print_global_file’ from ‘process_global_sql_commands’
# 1388| {
# 1389| snprintf(out_file_path, MAXPGPATH, "%s", outfile);
# 1390|-> OPF = fopen(out_file_path, PG_BINARY_W);
# 1391|
# 1392| if (OPF == NULL)
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_true: following ‘true’ branch (when ‘outfile’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: call_function: calling ‘copy_or_print_global_file’ from ‘process_global_sql_commands’
# 1388| {
# 1389| snprintf(out_file_path, MAXPGPATH, "%s", outfile);
# 1390|-> OPF = fopen(out_file_path, PG_BINARY_W);
# 1391|
# 1392| if (OPF == NULL)
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_true: following ‘true’ branch (when ‘outfile’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: call_function: calling ‘copy_or_print_global_file’ from ‘process_global_sql_commands’
# 1398|
# 1399| /* Append global.dat into output file or print to stdout. */
# 1400|-> while ((c = fgetc(pfile)) != EOF)
# 1401| fputc(c, OPF);
# 1402|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&global_file_path, "r")’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1302:1: enter_function: entry to ‘process_global_sql_commands’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1314:17: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1316:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1323:12: branch_true: following ‘true’ branch (when ‘outfile’ is non-NULL)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: branch_true: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1325:17: call_function: calling ‘copy_or_print_global_file’ from ‘process_global_sql_commands’
# 1398|
# 1399| /* Append global.dat into output file or print to stdout. */
# 1400|-> while ((c = fgetc(pfile)) != EOF)
# 1401| fputc(c, OPF);
# 1402|
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘OPF’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1385:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1389:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: throw: if ‘fgetc’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: danger: ‘OPF’ leaks here; was opened at [(3)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/2)
# 1398|
# 1399| /* Append global.dat into output file or print to stdout. */
# 1400|-> while ((c = fgetc(pfile)) != EOF)
# 1401| fputc(c, OPF);
# 1402|
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: warning[-Wanalyzer-malloc-leak]: leak of ‘OPF’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1385:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1389:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: throw: if ‘fgetc’ throws an exception...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1400:21: danger: ‘OPF’ leaks here; was allocated at [(3)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/2)
# 1398|
# 1399| /* Append global.dat into output file or print to stdout. */
# 1400|-> while ((c = fgetc(pfile)) != EOF)
# 1401| fputc(c, OPF);
# 1402|
Error: GCC_ANALYZER_WARNING (CWE-775):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: warning[-Wanalyzer-file-leak]: leak of FILE ‘OPF’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1385:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1389:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: acquire_resource: opened here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1406:12: branch_false: following ‘false’ branch (when the strings are equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: danger: ‘OPF’ leaks here; was opened at [(3)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/2)
# 1406| if (strcmp(outfile, "-") != 0)
# 1407| fclose(OPF);
# 1408|-> }
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: warning[-Wanalyzer-malloc-leak]: leak of ‘OPF’
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1385:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1389:17: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1390:23: acquire_memory: allocated here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1392:20: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1406:12: branch_false: following ‘false’ branch (when the strings are equal)...
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: branch_false: ...to here
postgresql-18beta1/src/bin/pg_dump/pg_restore.c:1408:1: danger: ‘OPF’ leaks here; was allocated at [(3)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/2)
# 1406| if (strcmp(outfile, "-") != 0)
# 1407| fclose(OPF);
# 1408|-> }
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18beta1/src/bin/psql/tab-complete.in.c:2555: warning[uninitvar]: Uninitialized variable: argarray
# 2553| COMPLETE_WITH("CONSTRAINT", "TO");
# 2554| /* ALTER DOMAIN <sth> RENAME CONSTRAINT <sth> */
# 2555|-> else if (Matches("ALTER", "DOMAIN", MatchAny, "RENAME", "CONSTRAINT", MatchAny))
# 2556| COMPLETE_WITH("TO");
# 2557|
Error: CPPCHECK_WARNING (CWE-457):
postgresql-18beta1/src/bin/psql/tab-complete.in.c:2605: warning[uninitvar]: Uninitialized variable: argarray
# 2603| COMPLETE_WITH("TO");
# 2604| /* ALTER VIEW xxx RENAME COLUMN yyy */
# 2605|-> else if (Matches("ALTER", "VIEW", MatchAny, "RENAME", "COLUMN", MatchAnyExcept("TO")))
# 2606| COMPLETE_WITH("TO");
# 2607| /* ALTER VIEW xxx RESET ( */
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:832:38: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:806:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:811:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:824:45: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:825:36: branch_false: following ‘false’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:831:33: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:832:38: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:832:38: danger: ‘crypt_pwd’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 830|
# 831| crypt_pwd2 = crypt_pwd + MD5_PASSWD_LEN + 1;
# 832|-> if (!pg_md5_encrypt(password, conn->pguser,
# 833| strlen(conn->pguser), crypt_pwd2,
# 834| &errstr))
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1372:14: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1368:21: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1369:12: branch_false: following ‘false’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1372:14: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1372:14: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1372:14: danger: ‘crypt_pwd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1370| return NULL;
# 1371|
# 1372|-> if (!pg_md5_encrypt(passwd, user, strlen(user), crypt_pwd, &errstr))
# 1373| {
# 1374| free(crypt_pwd);
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1485:30: warning[-Wanalyzer-malloc-leak]: leak of ‘crypt_pwd’
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1413:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1416:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1419:12: branch_false: following ‘false’ branch (when ‘algorithm’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1461:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1468:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1478:18: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1478:17: branch_true: following ‘true’ branch (when the strings are equal)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1480:29: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1480:29: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1481:20: branch_true: following ‘true’ branch (when ‘crypt_pwd’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1483:37: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1485:30: throw: if ‘pg_md5_encrypt’ throws an exception...
postgresql-18beta1/src/interfaces/libpq/fe-auth.c:1485:30: danger: ‘crypt_pwd’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 1483| const char *errstr = NULL;
# 1484|
# 1485|-> if (!pg_md5_encrypt(passwd, user, strlen(user), crypt_pwd, &errstr))
# 1486| {
# 1487| libpq_append_conn_error(conn, "could not encrypt password: %s", errstr);
Error: GCC_ANALYZER_WARNING (CWE-688):
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:119:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((long unsigned int)*conn.be_cancel_key_len)’ where non-null expected
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:73:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:77:12: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:77:12: branch_false: following ‘false’ branch (when ‘conn’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:83:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:83:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:90:13: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:90:12: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:99:9: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:101:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:107:14: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:107:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:113:30: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:114:12: branch_true: following ‘true’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:116:52: branch_true: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:116:45: acquire_memory: this call could return NULL
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:117:20: branch_false: following ‘false’ branch...
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:119:72: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-cancel.c:119:17: danger: argument 1 (‘malloc((long unsigned int)*conn.be_cancel_key_len)’) from [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14) could be NULL where non-null expected
# 117| if (!conn->be_cancel_key)
# 118| goto oom_error;
# 119|-> memcpy(cancelConn->be_cancel_key, conn->be_cancel_key, conn->be_cancel_key_len);
# 120| }
# 121| cancelConn->be_cancel_key_len = conn->be_cancel_key_len;
Error: GCC_ANALYZER_WARNING (CWE-401):
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2388:29: warning[-Wanalyzer-malloc-leak]: leak of ‘startpacket’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2313:1: enter_function: entry to ‘pqBuildStartupPacket3’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2318:22: call_function: calling ‘build_startup_packet’ from ‘pqBuildStartupPacket3’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2318:22: return_function: returning to ‘pqBuildStartupPacket3’ from ‘build_startup_packet’
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2319:32: acquire_memory: allocated here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2320:12: branch_false: following ‘false’ branch (when ‘startpacket’ is non-NULL)...
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2322:22: branch_false: ...to here
postgresql-18beta1/src/interfaces/libpq/fe-protocol3.c:2322:22: call_function: calling ‘build_startup_packet’ from ‘pqBuildStartupPacket3’
# 2386| if ((val = getenv(next_eo->envName)) != NULL)
# 2387| {
# 2388|-> if (pg_strcasecmp(val, "default") != 0)
# 2389| ADD_STARTUP_OPTION(next_eo->pgName, val);
# 2390| }