summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstratakis <cstratak@redhat.com>2021-06-02 14:54:33 (GMT)
committerGitHub <noreply@github.com>2021-06-02 14:54:33 (GMT)
commitbdb56902a3bfe12b10f85a941d5dd0eae739f1a8 (patch)
tree0a3947fb8449f1b949b38d328cf7362fcdba79c6
parentfbf25b8c0dd1e62db59117d53bbd2d4131a06867 (diff)
downloadcpython-bdb56902a3bfe12b10f85a941d5dd0eae739f1a8.zip
cpython-bdb56902a3bfe12b10f85a941d5dd0eae739f1a8.tar.gz
cpython-bdb56902a3bfe12b10f85a941d5dd0eae739f1a8.tar.bz2
bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486)
This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well.
-rw-r--r--Modules/getpath.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 44453f2..363d62a 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -1263,6 +1263,7 @@ calculate_read_pyenv(PyCalculatePath *calculate)
status = calculate_open_pyenv(calculate, &env_file);
if (_PyStatus_EXCEPTION(status)) {
+ assert(env_file == NULL);
return status;
}
if (env_file == NULL) {