coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] maint: avoid an inconsequential mem leak


From: Pádraig Brady
Subject: [PATCH] maint: avoid an inconsequential mem leak
Date: Sun, 13 Jul 2014 19:18:27 +0100

* src/df.c (get_disk): Avoid an inconsequential mem leak
spotted by coverity.
---
 src/df.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/df.c b/src/df.c
index 063cabf..c84716a 100644
--- a/src/df.c
+++ b/src/df.c
@@ -1185,7 +1185,11 @@ get_disk (char const *disk)
                 {
                   best_match = me;
                   if (len == 1) /* Traditional root.  */
-                    break;
+                    {
+                      free (last_device);
+                      free (canon_dev);
+                      break;
+                    }
                   else
                     best_match_len = len;
                 }
-- 
1.7.7.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]