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.
This commit is contained in:
@@ -1263,6 +1263,7 @@ calculate_read_pyenv(PyCalculatePath *calculate)
|
|||||||
|
|
||||||
status = calculate_open_pyenv(calculate, &env_file);
|
status = calculate_open_pyenv(calculate, &env_file);
|
||||||
if (_PyStatus_EXCEPTION(status)) {
|
if (_PyStatus_EXCEPTION(status)) {
|
||||||
|
assert(env_file == NULL);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
if (env_file == NULL) {
|
if (env_file == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user