[PATCH 5/9] [libply] Fix message list memleaks

Frederic Crozat fcrozat at mandriva.com
Mon Aug 10 04:36:51 PDT 2009


---
 src/libply/ply-progress.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/libply/ply-progress.c b/src/libply/ply-progress.c
index f8a84ab..bd7567d 100644
--- a/src/libply/ply-progress.c
+++ b/src/libply/ply-progress.c
@@ -90,6 +90,32 @@ ply_progress_new (void)
 void
 ply_progress_free (ply_progress_t* progress)
 {
+  ply_list_node_t *node;
+  node = ply_list_get_first_node (progress->current_message_list);
+
+  while (node)
+   {
+      ply_list_node_t *next_node;
+      ply_progress_message_t *message = ply_list_node_get_data (node);
+      next_node = ply_list_get_next_node (progress->current_message_list, node);
+
+      free (message->string);
+      node = next_node;
+    }
+  ply_list_free (progress->current_message_list);
+
+  node = ply_list_get_first_node (progress->previous_message_list);
+
+  while (node)
+   {
+      ply_list_node_t *next_node;
+      ply_progress_message_t *message = ply_list_node_get_data (node);
+      next_node = ply_list_get_next_node (progress->previous_message_list, node);
+
+      free (message->string);
+      node = next_node;
+    }
+  ply_list_free (progress->previous_message_list);
   free(progress);
   return;
 }
-- 
1.6.4


--=-XBPOfM0g7BgBIfvLZXUv
Content-Disposition: inline; filename="0006-libply-Fix-memleak-in-command-parser.patch"
Content-Type: text/x-patch; name="0006-libply-Fix-memleak-in-command-parser.patch"; charset="ISO-8859-15"
Content-Transfer-Encoding: 7bit



More information about the plymouth mailing list