]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix os.posix_spawn() error handling (#142532)
authorBartosz Sławecki <bartosz@ilikepython.com>
Thu, 11 Dec 2025 17:02:26 +0000 (18:02 +0100)
committerGitHub <noreply@github.com>
Thu, 11 Dec 2025 17:02:26 +0000 (18:02 +0100)
Consistently use `goto exit;` in `py_posix_spawn()`.

Modules/posixmodule.c

index fc609b2707c6c69212c5b6412c67039731bf6fcc..221cfc5a93419802f7a5f6267aece1796d25bd6e 100644 (file)
@@ -7903,7 +7903,7 @@ py_posix_spawn(int use_posix_spawnp, PyObject *module, path_t *path, PyObject *a
     if (argc < 1) {
         PyErr_Format(PyExc_ValueError,
                      "%s: argv must not be empty", func_name);
-        return NULL;
+        goto exit;
     }
 
     if (!PyMapping_Check(env) && env != Py_None) {