emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#12542: closed ([PATCH] du: avoid abort on systems


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#12542: closed ([PATCH] du: avoid abort on systems for which ->me_type is not malloc'd)
Date: Sun, 30 Sep 2012 12:44:01 +0000

Your message dated Sun, 30 Sep 2012 14:43:18 +0200
with message-id <address@hidden>
and subject line Re: bug#12542: [PATCH] du: avoid abort on systems for which 
->me_type is not malloc'd
has caused the debbugs.gnu.org bug report #12542,
regarding [PATCH] du: avoid abort on systems for which ->me_type is not malloc'd
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
12542: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12542
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] du: avoid abort on systems for which ->me_type is not malloc'd Date: Sun, 30 Sep 2012 14:32:35 +0200
I noticed that "make check" was failing a fundamental test of du
on OpenBSD.  It would have been trivial to diagnose with valgrind,
but that tool wasn't easily available on the affected system...

[I'm reporting this to the bug- mailing list, since I suppose we
 should report all bugs there. ]


>From caaf7cce39828ef3e90766fe2d6cc64559c13a60 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 30 Sep 2012 14:28:47 +0200
Subject: [PATCH] du: avoid abort on systems for which ->me_type is not
 malloc'd

On some systems (notably, BSD-based, like at least OpenBSD 4.9),
the me_type member does not come from the heap.
* src/du.c (fill_mount_table): Free the ->me_type member only
when it was malloc'd, i.e., when ->me_type_malloced is nonzero.
Bug introduced via commit v8.19-2-gcf7e1b5.
---
 src/du.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/du.c b/src/du.c
index ee90da9..63daaa9 100644
--- a/src/du.c
+++ b/src/du.c
@@ -660,7 +660,8 @@ fill_mount_table (void)

       free (mnt_free->me_devname);
       free (mnt_free->me_mountdir);
-      free (mnt_free->me_type);
+      if (mnt_free->me_type_malloced)
+        free (mnt_free->me_type);
       free (mnt_free);
     }
 }
--
1.7.12.1.382.gb0576a6



--- End Message ---
--- Begin Message --- Subject: Re: bug#12542: [PATCH] du: avoid abort on systems for which ->me_type is not malloc'd Date: Sun, 30 Sep 2012 14:43:18 +0200
Jim Meyering wrote:
> I noticed that "make check" was failing a fundamental test of du
> on OpenBSD.  It would have been trivial to diagnose with valgrind,
> but that tool wasn't easily available on the affected system...

I've just pushed the patch.
A better one should come soon, in which I add
a function in mountlist.c (declared in the .h file)
by which to encapsulate this mount-entry freeing process.


--- End Message ---

reply via email to

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