summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs/multibytecodec.h
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2006-03-27 08:24:54 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2006-03-27 08:24:54 (GMT)
commitb9c03e999f74ef87f72b6aea8c68618b1e93545b (patch)
tree6c243d90c749b1c3e1794f191124a2da0d1f28ea /Modules/cjkcodecs/multibytecodec.h
parent40108c97fb490318e7fb30353c3475ada7de98f9 (diff)
downloadcpython-b9c03e999f74ef87f72b6aea8c68618b1e93545b.zip
cpython-b9c03e999f74ef87f72b6aea8c68618b1e93545b.tar.gz
cpython-b9c03e999f74ef87f72b6aea8c68618b1e93545b.tar.bz2
Fix reference leaks introduced by the recent incremental codec
changes.
Diffstat (limited to 'Modules/cjkcodecs/multibytecodec.h')
-rw-r--r--Modules/cjkcodecs/multibytecodec.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.h b/Modules/cjkcodecs/multibytecodec.h
index 671ecae..22ea5d4 100644
--- a/Modules/cjkcodecs/multibytecodec.h
+++ b/Modules/cjkcodecs/multibytecodec.h
@@ -123,10 +123,10 @@ typedef struct {
#define ERROR_IGNORE (PyObject *)(2)
#define ERROR_REPLACE (PyObject *)(3)
#define ERROR_ISCUSTOM(p) ((p) < ERROR_STRICT || ERROR_REPLACE < (p))
-#define ERROR_DECREF(p) do { \
- if (ERROR_ISCUSTOM(p)) { \
- Py_DECREF(p); \
- } \
+#define ERROR_DECREF(p) do { \
+ if (p != NULL && ERROR_ISCUSTOM(p)) { \
+ Py_DECREF(p); \
+ } \
} while (0);
#define MBENC_FLUSH 0x0001 /* encode all characters encodable */