qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH for 4.2 0/3] require newer glib2 to enable autofree'ing of stack variables exiting scope
Date: Thu, 25 Jul 2019 10:13:11 +0100	[thread overview]
Message-ID: <CAFEAcA-jz2Dsso1cBxEhCu7kq++T1vH--Q_AuBTYzxQxttDNCw@mail.gmail.com> (raw)
In-Reply-To: <20190723154856.17348-1-berrange@redhat.com>

On Tue, 23 Jul 2019 at 16:49, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> Both GCC and CLang support a C extension attribute((cleanup)) which
> allows you to define a function that is invoked when a stack variable
> exits scope. This typically used to free the memory allocated to it,
> though you're not restricted to this. For example it could be used to
> unlock a mutex.

Does Coverity handle this? Can it be made to wire up this kind
of deallocation into checks of use-after-free/memory leaks/etc?

thanks
- PMM


  parent reply	other threads:[~2019-07-25  9:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 15:48 [Qemu-devel] [PATCH for 4.2 0/3] require newer glib2 to enable autofree'ing of stack variables exiting scope Daniel P. Berrangé
2019-07-23 15:48 ` [Qemu-devel] [PATCH for 4.2 1/3] glib: bump min required glib library version to 2.48 Daniel P. Berrangé
2019-07-23 16:02   ` Thomas Huth
2019-07-23 16:04     ` Daniel P. Berrangé
2019-07-23 15:48 ` [Qemu-devel] [PATCH for 4.2 2/3] crypto: define cleanup functions for use with g_autoptr Daniel P. Berrangé
2019-07-23 15:48 ` [Qemu-devel] [PATCH for 4.2 3/3] crypto: use auto cleanup for many stack variables Daniel P. Berrangé
2019-07-23 19:17 ` [Qemu-devel] [PATCH for 4.2 0/3] require newer glib2 to enable autofree'ing of stack variables exiting scope no-reply
2019-07-25  8:38 ` Stefan Hajnoczi
2019-07-25  9:13 ` Peter Maydell [this message]
2019-07-25  9:24   ` Daniel P. Berrangé

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=CAFEAcA-jz2Dsso1cBxEhCu7kq++T1vH--Q_AuBTYzxQxttDNCw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).