##// END OF EJS Templates
bdiff: use Python memory allocator in fixws...
Gregory Szorc -
r31467:08ecec29 default
parent child Browse files
Show More
@@ -158,7 +158,7 b' static PyObject *fixws(PyObject *self, P'
158 r = PyBytes_AsString(s);
158 r = PyBytes_AsString(s);
159 rlen = PyBytes_Size(s);
159 rlen = PyBytes_Size(s);
160
160
161 w = (char *)malloc(rlen ? rlen : 1);
161 w = (char *)PyMem_Malloc(rlen ? rlen : 1);
162 if (!w)
162 if (!w)
163 goto nomem;
163 goto nomem;
164
164
@@ -178,7 +178,7 b' static PyObject *fixws(PyObject *self, P'
178 result = PyBytes_FromStringAndSize(w, wlen);
178 result = PyBytes_FromStringAndSize(w, wlen);
179
179
180 nomem:
180 nomem:
181 free(w);
181 PyMem_Free(w);
182 return result ? result : PyErr_NoMemory();
182 return result ? result : PyErr_NoMemory();
183 }
183 }
184
184
General Comments 0
You need to be logged in to leave comments. Login now