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
d1e0ef68
Commit
d1e0ef68
authored
18 years ago
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SF #1445431, fix some leaks in error conditions.
parent
c3264e50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
Modules/parsermodule.c
Modules/parsermodule.c
+14
-9
Modules/posixmodule.c
Modules/posixmodule.c
+5
-4
No files found.
Modules/parsermodule.c
View file @
d1e0ef68
...
...
@@ -657,9 +657,10 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
}
}
if
(
!
ok
)
{
PyErr_SetObject
(
parser_error
,
Py_BuildValue
(
"os"
,
elem
,
"Illegal node construct."
));
PyObject
*
err
=
Py_BuildValue
(
"os"
,
elem
,
"Illegal node construct."
);
PyErr_SetObject
(
parser_error
,
err
);
Py_XDECREF
(
err
);
Py_XDECREF
(
elem
);
return
(
0
);
}
...
...
@@ -710,8 +711,9 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
* It has to be one or the other; this is an error.
* Throw an exception.
*/
PyErr_SetObject
(
parser_error
,
Py_BuildValue
(
"os"
,
elem
,
"unknown node type."
));
PyObject
*
err
=
Py_BuildValue
(
"os"
,
elem
,
"unknown node type."
);
PyErr_SetObject
(
parser_error
,
err
);
Py_XDECREF
(
err
);
Py_XDECREF
(
elem
);
return
(
0
);
}
...
...
@@ -762,6 +764,7 @@ build_node_tree(PyObject *tuple)
tuple
=
Py_BuildValue
(
"os"
,
tuple
,
"Illegal syntax-tree; cannot start with terminal symbol."
);
PyErr_SetObject
(
parser_error
,
tuple
);
Py_XDECREF
(
tuple
);
}
else
if
(
ISNONTERMINAL
(
num
))
{
/*
...
...
@@ -792,14 +795,16 @@ build_node_tree(PyObject *tuple)
}
}
}
else
else
{
/* The tuple is illegal -- if the number is neither TERMINAL nor
* NONTERMINAL, we can't use it. Not sure the implementation
* allows this condition, but the API doesn't preclude it.
*/
PyErr_SetObject
(
parser_error
,
Py_BuildValue
(
"os"
,
tuple
,
"Illegal component tuple."
));
PyObject
*
err
=
Py_BuildValue
(
"os"
,
tuple
,
"Illegal component tuple."
);
PyErr_SetObject
(
parser_error
,
err
);
Py_XDECREF
(
err
);
}
return
(
res
);
}
...
...
This diff is collapsed.
Click to expand it.
Modules/posixmodule.c
View file @
d1e0ef68
...
...
@@ -6396,15 +6396,16 @@ posix_tmpnam(PyObject *self, PyObject *noargs)
name
=
tmpnam
(
buffer
);
#endif
if
(
name
==
NULL
)
{
PyErr_SetObject
(
PyExc_OSError
,
Py_BuildValue
(
"is"
,
0
,
PyObject
*
err
=
Py_BuildValue
(
"is"
,
0
,
#ifdef USE_TMPNAM_R
"unexpected NULL from tmpnam_r"
#else
"unexpected NULL from tmpnam"
#endif
));
return
NULL
;
);
PyErr_SetObject
(
PyExc_OSError
,
err
);
Py_XDECREF
(
err
);
return
NULL
;
}
return
PyString_FromString
(
buffer
);
}
...
...
This diff is collapsed.
Click to expand it.
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