1 | initial version |

It looks to me like there may be several memory leaks in `devel/sage/sage/graphs/cliquer.pyx`

. Notice, for example:

```
cdef graph_t *g
g=graph_new(graph.order())
```

But then we never deallocate the g memory. It looks like cliquer/graph.h also defines a graph_free function, and it looks awfully suspicious that we never call it anywhere in that file after we've done a graph_new. We'd have to add graph_free to the cliquer.pxd file as well.

2 | No.2 Revision |

It looks to me like there may be several memory leaks in `devel/sage/sage/graphs/cliquer.pyx`

. Notice, for example:

```
cdef graph_t *g
g=graph_new(graph.order())
```

But then we never deallocate the g memory. It looks like cliquer/graph.h also defines a graph_free function, and it looks awfully suspicious that we never call it anywhere in that file after we've done a graph_new. We'd have to add graph_free to the cliquer.pxd file as well.

Edit: Section B of the cliquer manual says to use graph_free to free the graph given by graph_new.

3 | No.3 Revision |

It looks to me like there may be several memory leaks in `devel/sage/sage/graphs/cliquer.pyx`

. Notice, for example:

```
cdef graph_t *g
g=graph_new(graph.order())
```

But then we never deallocate the g memory. It looks like cliquer/graph.h also defines a graph_free function, and it looks awfully suspicious that we never call it anywhere in that file after we've done a graph_new. We'd have to add graph_free to the cliquer.pxd file as well.

Edit: Section B of the cliquer manual says to use graph_free to free the graph given by graph_new.

Edit 2: There are more memory leaks. I think the list that is returned from the cliquer function calls should be freed with `free`

, and inside the cliquer package, I think the cliquer options structs should be freed (i.e., any call to `sage_init_clique_opt()`

should be saved as a variable and then freed at the end of the function).

4 | No.4 Revision |

`devel/sage/sage/graphs/cliquer.pyx`

. Notice, for example:

```
cdef graph_t *g
g=graph_new(graph.order())
```

Edit: Section B of the cliquer manual says to use graph_free to free the graph given by graph_new.

Edit 2: There are more memory leaks. I think the list that is returned from the cliquer function calls should be freed with `free`

, and inside the cliquer package, I think the cliquer options structs should be freed (i.e., any call to `sage_init_clique_opt()`

should be saved as a variable and then freed at the end of the function).

Edit 3: I've moved these findings to http://trac.sagemath.org/sage_trac/ticket/12622 and posted up some preliminary patches and diffs there.

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.