comparison Python/sysmodule.c @ 68102:e2f96bd29252

Issue #8914: fix various warnings from the Clang static analyzer v254.
author Brett Cannon <bcannon@gmail.com>
date Tue, 22 Feb 2011 20:15:44 +0000
parents 912fd20de0e0
children b39270c6b8d1
comparison
equal deleted inserted replaced
68101:a7515a94fdb5 68102:e2f96bd29252
1174 PySys_AddXOption(const wchar_t *s) 1174 PySys_AddXOption(const wchar_t *s)
1175 { 1175 {
1176 PyObject *opts; 1176 PyObject *opts;
1177 PyObject *name = NULL, *value = NULL; 1177 PyObject *name = NULL, *value = NULL;
1178 const wchar_t *name_end; 1178 const wchar_t *name_end;
1179 int r;
1180 1179
1181 opts = get_xoptions(); 1180 opts = get_xoptions();
1182 if (opts == NULL) 1181 if (opts == NULL)
1183 goto error; 1182 goto error;
1184 1183
1192 name = PyUnicode_FromWideChar(s, name_end - s); 1191 name = PyUnicode_FromWideChar(s, name_end - s);
1193 value = PyUnicode_FromWideChar(name_end + 1, -1); 1192 value = PyUnicode_FromWideChar(name_end + 1, -1);
1194 } 1193 }
1195 if (name == NULL || value == NULL) 1194 if (name == NULL || value == NULL)
1196 goto error; 1195 goto error;
1197 r = PyDict_SetItem(opts, name, value); 1196 PyDict_SetItem(opts, name, value);
1198 Py_DECREF(name); 1197 Py_DECREF(name);
1199 Py_DECREF(value); 1198 Py_DECREF(value);
1200 return; 1199 return;
1201 1200
1202 error: 1201 error: