mirror of
https://github.com/python/cpython.git
synced 2025-09-30 04:15:43 +00:00
When os.spawnv() fails while handling arguments, free correctly
argvlist: pass lastarg+1 rather than lastarg to free_string_array()
to also free the first item.
(cherry picked from commit 8acb4cf2b3
)
This commit is contained in:
parent
38d6a40898
commit
b78fbaaeab
1 changed files with 1 additions and 1 deletions
|
@ -5106,7 +5106,7 @@ os_spawnv_impl(PyObject *module, int mode, path_t *path, PyObject *argv)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (i == 0 && !argvlist[0][0]) {
|
if (i == 0 && !argvlist[0][0]) {
|
||||||
free_string_array(argvlist, i);
|
free_string_array(argvlist, i + 1);
|
||||||
PyErr_SetString(
|
PyErr_SetString(
|
||||||
PyExc_ValueError,
|
PyExc_ValueError,
|
||||||
"spawnv() arg 2 first element cannot be empty");
|
"spawnv() arg 2 first element cannot be empty");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue