File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Original file line number Diff line number Diff line change @@ -2491,15 +2491,13 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
2491
2491
#ifdef MS_WINDOWS
2492
2492
PyObject * unicode_path ;
2493
2493
if (PyUnicode_FSDecoder (path , & unicode_path ) < 0 ) {
2494
- Py_DECREF (path );
2495
- return NULL ;
2494
+ goto error ;
2496
2495
}
2497
2496
// Use UTF-16 (wide char) version of the path for permission checks
2498
2497
wchar_t * debugger_script_path_w = PyUnicode_AsWideCharString (unicode_path , NULL );
2499
2498
Py_DECREF (unicode_path );
2500
2499
if (debugger_script_path_w == NULL ) {
2501
- Py_DECREF (path );
2502
- return NULL ;
2500
+ goto error ;
2503
2501
}
2504
2502
DWORD attr = GetFileAttributesW (debugger_script_path_w );
2505
2503
if (attr == INVALID_FILE_ATTRIBUTES ) {
@@ -2514,8 +2512,7 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
2514
2512
else {
2515
2513
PyErr_SetFromWindowsErr (err );
2516
2514
}
2517
- Py_DECREF (path );
2518
- return NULL ;
2515
+ goto error ;
2519
2516
}
2520
2517
PyMem_Free (debugger_script_path_w );
2521
2518
#else // MS_WINDOWS
@@ -2530,17 +2527,19 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
2530
2527
default :
2531
2528
PyErr_SetFromErrno (PyExc_OSError );
2532
2529
}
2533
- Py_DECREF (path );
2534
- return NULL ;
2530
+ goto error ;
2535
2531
}
2536
2532
#endif // MS_WINDOWS
2537
2533
if (_PySysRemoteDebug_SendExec (pid , 0 , debugger_script_path ) < 0 ) {
2538
- Py_DECREF (path );
2539
- return NULL ;
2534
+ goto error ;
2540
2535
}
2541
2536
2542
2537
Py_DECREF (path );
2543
2538
Py_RETURN_NONE ;
2539
+
2540
+ error :
2541
+ Py_DECREF (path );
2542
+ return NULL ;
2544
2543
}
2545
2544
2546
2545
You can’t perform that action at this time.
0 commit comments