Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ad62489e
Commit
ad62489e
authored
Jun 04, 2006
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1500293: fix memory leaks in _subprocess module.
parent
ddbaa660
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
Lib/subprocess.py
Lib/subprocess.py
+5
-5
PC/_subprocess.c
PC/_subprocess.c
+10
-3
No files found.
Lib/subprocess.py
View file @
ad62489e
...
...
@@ -388,6 +388,7 @@ if mswindows:
hStdInput
=
None
hStdOutput
=
None
hStdError
=
None
wShowWindow
=
0
class
pywintypes
:
error
=
IOError
else
:
...
...
@@ -744,18 +745,17 @@ class Popen(object):
args
=
list2cmdline
(
args
)
# Process startup details
default_startupinfo
=
STARTUPINFO
()
if
startupinfo
is
None
:
startupinfo
=
default_startupinfo
if
not
None
in
(
p2cread
,
c2pwrite
,
errwrite
):
startupinfo
=
STARTUPINFO
()
if
None
not
in
(
p2cread
,
c2pwrite
,
errwrite
):
startupinfo
.
dwFlags
|=
STARTF_USESTDHANDLES
startupinfo
.
hStdInput
=
p2cread
startupinfo
.
hStdOutput
=
c2pwrite
startupinfo
.
hStdError
=
errwrite
if
shell
:
default_
startupinfo
.
dwFlags
|=
STARTF_USESHOWWINDOW
default_
startupinfo
.
wShowWindow
=
SW_HIDE
startupinfo
.
dwFlags
|=
STARTF_USESHOWWINDOW
startupinfo
.
wShowWindow
=
SW_HIDE
comspec
=
os
.
environ
.
get
(
"COMSPEC"
,
"cmd.exe"
)
args
=
comspec
+
" /c "
+
args
if
(
GetVersion
()
>=
0x80000000
L
or
...
...
PC/_subprocess.c
View file @
ad62489e
...
...
@@ -250,19 +250,23 @@ static int
getint
(
PyObject
*
obj
,
char
*
name
)
{
PyObject
*
value
;
int
ret
;
value
=
PyObject_GetAttrString
(
obj
,
name
);
if
(
!
value
)
{
PyErr_Clear
();
/* FIXME: propagate error? */
return
0
;
}
return
(
int
)
PyInt_AsLong
(
value
);
ret
=
(
int
)
PyInt_AsLong
(
value
);
Py_DECREF
(
value
);
return
ret
;
}
static
HANDLE
gethandle
(
PyObject
*
obj
,
char
*
name
)
{
sp_handle_object
*
value
;
HANDLE
ret
;
value
=
(
sp_handle_object
*
)
PyObject_GetAttrString
(
obj
,
name
);
if
(
!
value
)
{
...
...
@@ -270,8 +274,11 @@ gethandle(PyObject* obj, char* name)
return
NULL
;
}
if
(
value
->
ob_type
!=
&
sp_handle_type
)
return
NULL
;
return
value
->
handle
;
ret
=
NULL
;
else
ret
=
value
->
handle
;
Py_DECREF
(
value
);
return
ret
;
}
static
PyObject
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment