util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Masatake YAMATO <yamato@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: memory leaks tests (Re: [PATCH] Fix a potential memory leak at mnt_table_parse_dir)
Date: Fri, 20 Jan 2012 10:34:33 +0100	[thread overview]
Message-ID: <20120120093433.GA13157@x2.net.home> (raw)
In-Reply-To: <20120120.130034.1018682633157048125.yamato@redhat.com>

On Fri, Jan 20, 2012 at 01:00:34PM +0900, Masatake YAMATO wrote:
> mnt_table_parse_dir in libmount/src/tab_parse.c calls
> scandir, and then opendir. When the latter one, opendir is failed, 
> buffers allocated in scandir are not released.

 Thanks, I'll apply the patch.

 BTW, it's possible to compile some test binaries by:

    make -C libmount/src tests

 these programs are used in tests/ts/libmount regression tests.

 It would be nice to add valgrind (or so) to the tests and check for
 mem-leaks. (Ideally add some simple infrastructure to tests/functions.sh
 and log valgrind output to "$TS_OUTPUT.mem".)  Volunteer? ;-)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2012-01-20  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20  4:00 [PATCH] Fix a potential memory leak at mnt_table_parse_dir Masatake YAMATO
2012-01-20  9:34 ` Karel Zak [this message]
2012-01-30 11:08   ` memory leaks tests (Re: [PATCH] Fix a potential memory leak at mnt_table_parse_dir) Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120120093433.GA13157@x2.net.home \
    --to=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    --cc=yamato@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).