Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/_speedups.c @ 557:ba8f1295e1e2
For consistency reasons: set tmp to NULL if not useable any more
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 04 Jan 2022 21:33:09 +0100 |
| parents | 3d5ef056134c |
| children | 7a3c311991d7 |
comparison
equal
deleted
inserted
replaced
| 556:3d5ef056134c | 557:ba8f1295e1e2 |
|---|---|
| 870 goto error; | 870 goto error; |
| 871 } | 871 } |
| 872 } | 872 } |
| 873 else { | 873 else { |
| 874 if (PyTuple_Size(tmp) != 2) { | 874 if (PyTuple_Size(tmp) != 2) { |
| 875 Py_DECREF(tmp); | 875 Py_DECREF(tmp); tmp = NULL; |
| 876 PyErr_SetString(PyExc_TypeError, "tuple of size 2 expected"); | 876 PyErr_SetString(PyExc_TypeError, "tuple of size 2 expected"); |
| 877 goto error; | 877 goto error; |
| 878 } | 878 } |
| 879 /* unpack the result */ | 879 /* unpack the result */ |
| 880 varvalue = PyTuple_GetItem(tmp, 0); /* borrowed -- but want own */ | 880 varvalue = PyTuple_GetItem(tmp, 0); /* borrowed -- but want own */ |
| 912 tmp = PyObject_Str(varvalue); | 912 tmp = PyObject_Str(varvalue); |
| 913 if (tmp == NULL) { | 913 if (tmp == NULL) { |
| 914 goto error; | 914 goto error; |
| 915 } | 915 } |
| 916 if (PyList_Append(res_parts, tmp) < 0) { | 916 if (PyList_Append(res_parts, tmp) < 0) { |
| 917 Py_DECREF(tmp); | 917 Py_DECREF(tmp); tmp = NULL; |
| 918 goto error; | 918 goto error; |
| 919 } | 919 } |
| 920 Py_DECREF(tmp); | 920 Py_DECREF(tmp); |
| 921 } | 921 } |
| 922 Py_DECREF(varvalue); varvalue = NULL; | 922 Py_DECREF(varvalue); varvalue = NULL; |
| 924 tmp = PyUnicode_Substring(pb, idx+2, pb_len); | 924 tmp = PyUnicode_Substring(pb, idx+2, pb_len); |
| 925 if (tmp == NULL) { | 925 if (tmp == NULL) { |
| 926 goto error; | 926 goto error; |
| 927 } | 927 } |
| 928 if (PyList_Append(res_parts, tmp) < 0) { | 928 if (PyList_Append(res_parts, tmp) < 0) { |
| 929 Py_DECREF(tmp); | 929 Py_DECREF(tmp); tmp = NULL; |
| 930 goto error; | 930 goto error; |
| 931 } | 931 } |
| 932 Py_DECREF(tmp); tmp = NULL; | 932 Py_DECREF(tmp); tmp = NULL; |
| 933 } | 933 } |
| 934 | 934 |
