Changeset 40
- Timestamp:
- 11/07/10 20:08:49 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pymigemo/pymigemo.c
r38 r40 11 11 #include <stdbool.h> 12 12 #include <string.h> 13 #include <stdlib.h> 13 14 #include <errno.h> 14 15 #include <sys/types.h> … … 171 172 { 172 173 PyObject *result, *pyquery, *pyrestr; 173 char *query, encoding[7];174 char encoding[7], *query = NULL; 174 175 unsigned char *regex; 175 176 … … 192 193 } 193 194 194 query = PyString_AS_STRING(q);195 query = strdup(PyString_AS_STRING(q)); 195 196 Py_DECREF(q); 196 197 } 197 198 else if (PyString_Check(pyquery)) { 198 query = PyString_AS_STRING(pyquery);199 query = strdup(PyString_AS_STRING(pyquery)); 199 200 } 200 201 else { … … 207 208 208 209 regex = migemo_query(self->migemo_obj, query); 210 free(query); 209 211 if (regex == NULL) { 210 212 PyErr_SetString(PyExc_AssertionError, "migemo_query() failed");
Note: See TracChangeset
for help on using the changeset viewer.