Ticket #19598: patch-quadtree-_treemodule.c.diff

File patch-quadtree-_treemodule.c.diff, 621 bytes (added by voldmar@…, 16 years ago)
  • quadtree/_treemodule.c

    old new  
    165165{
    166166    int *hits, count=0, i;
    167167    double min[2], max[2];
    168     PyObject *list;
     168    PyObject *list, *iter;
    169169
    170170    if (!PyArg_ParseTuple(args, "(dddd)", &min[0], &min[1], &max[0], &max[1]))
    171171        return NULL;
     
    177177        PyList_SET_ITEM(list, (size_t)i, Py_BuildValue("i", hits[i]));
    178178    }
    179179   
    180     return PySeqIter_New(list);
     180    free(hits);
     181
     182    iter = PySeqIter_New(list);
     183    Py_DECREF(list);
     184    return iter;
    181185}
    182186
    183187/* Define Methods */