1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Fix graph free valgrind warnings

Due to the way we set up the graph structure, we don't always have good
parent information. The changes made in dd8cf0c12d assumed this, so
back them out and just live with the dead pointers being there in the
memory while we are cleaning up after ourselves.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-06-08 02:47:26 -05:00
parent beffab02c4
commit 11ba7a0e8a

View File

@ -34,18 +34,7 @@ pmgraph_t *_alpm_graph_new(void)
void _alpm_graph_free(void *data)
{
pmgraph_t *graph = data;
/* make my children forget about me */
for(alpm_list_t *i = graph->children; i; i = i->next) {
pmgraph_t *child = i->data;
child->parent = NULL;
}
alpm_list_free(graph->children);
/* and make my parents forget about me too */
if(graph->parent) {
alpm_list_t *me = alpm_list_find_ptr(graph->parent->children, &data);
graph->parent->children = alpm_list_remove_item(graph->parent->children,
me);
}
free(graph);
}