Hi all! I'm wiriting a library that permits operations with graphs, i have some problem with the deallocation of memory. There is a function that takes a pointer to a graph (structure) as parameter, then it clear all the nodes of the graphs calling another function (that will clear also the edges). After removing the nodes, it just call the free((void*)g) where g is the pointer to the graph... but it seems that has no effect, because: the nodes and the edges are correctly deleted but the pointer to the graph is not NULL when the funciont retruns!! Here there is posted the code of the function: void free_graph (graph_t* g) { if (g) { node_t *tmp = g->nodes; while (tmp) { if (remove_node(g, tmp->label)) fprintf(stderr, "Error removing node"); tmp = tmp->next; } free((void*)g); } } The function remove_node() works correctly i've tested it. I'm a beginner is there someone ho can help me please?? THANKS!