diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-12 01:43:40 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-12 01:43:40 +0000 |
commit | 6f5ff3f3eb7abc2f4750c1319b560f67faf546ac (patch) | |
tree | 1b84bed27afcf3a62f50a2a2a6dabe162327866a /Python/symtable.c | |
parent | 2a899c8b767144e809418fd04f83e4e5789084cd (diff) | |
download | cpython-git-6f5ff3f3eb7abc2f4750c1319b560f67faf546ac.tar.gz |
Klocwork made another run and found a bunch more problems.
This is the first batch of fixes that should be easy to verify based on context.
This fixes problem numbers: 220 (ast), 323-324 (symtable),
321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 439a24349d..3e58b5034e 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -915,6 +915,8 @@ symtable_new_tmpname(struct symtable *st) PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++st->st_cur->ste_tmpname); tmp = PyString_InternFromString(tmpname); + if (!tmp) + return 0; if (!symtable_add_def(st, tmp, DEF_LOCAL)) return 0; Py_DECREF(tmp); @@ -1323,8 +1325,11 @@ symtable_visit_alias(struct symtable *st, alias_ty a) PyObject *name = (a->asname == NULL) ? a->name : a->asname; const char *base = PyString_AS_STRING(name); char *dot = strchr(base, '.'); - if (dot) + if (dot) { store_name = PyString_FromStringAndSize(base, dot - base); + if (!store_name) + return 0; + } else { store_name = name; Py_INCREF(store_name); |