From: Sudarshan Bisht <sudarshan.bisht@nokia.com>
To: ext Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] alsa-lib: fixed coverity reported issues under "USE_AFTER_FREE" checker.
Date: Thu, 17 Mar 2011 15:33:47 +0200 [thread overview]
Message-ID: <1300368827.2435.72.camel@Sudarshan.research.nokia.com> (raw)
In-Reply-To: <4D81EEF0.6010109@ladisch.de>
On Thu, 2011-03-17 at 12:22 +0100, ext Clemens Ladisch wrote:
> sudarshan.bisht@nokia.com wrote:
> > --- a/src/control/control_hw.c
> > +++ b/src/control/control_hw.c
> > @@ -414,6 +414,7 @@ int snd_ctl_hw_open(snd_ctl_t **handle, const char *name, int card, int mode)
> > if (err < 0) {
> > close(fd);
> > free(hw);
> > + hw = NULL;
> > }
>
> In this place, it's just a "return err" that is missing.
Ok.
>
> > --- a/src/mixer/mixer.c
> > +++ b/src/mixer/mixer.c
> > @@ -205,7 +205,7 @@ int snd_mixer_attach(snd_mixer_t *mixer, const char *name)
> > return err;
> > err = snd_mixer_attach_hctl(mixer, hctl);
> > if (err < 0) {
> > - snd_hctl_close(hctl);
> > + /* ideally hctl should be freed here, but it's taken care in snd_mixer_attach_hctl*/
> > return err;
> > }
>
> If the calloc() in snd_mixer_attach_hctl() fails, hctl is not freed.
> The bug is the inconsistent error handling cleanup in
> snd_mixer_attach_hctl(); I think it shouldn't free its hctl in any case.
Ok, I will remove freeing of hctl from snd_mixer_attach_hctl().
>
>
> Regards,
> Clemens
Br,
Sudarshan Bisht
next prev parent reply other threads:[~2011-03-17 13:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 8:12 [PATCH] *** Fixed issues/defects reported by Coverity tool *** sudarshan.bisht
2011-03-17 8:12 ` [PATCH] alsa-lib: fixed coverity reported issues under "USE_AFTER_FREE" checker sudarshan.bisht
2011-03-17 11:22 ` Clemens Ladisch
2011-03-17 13:33 ` Sudarshan Bisht [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-03-17 13:39 sudarshan.bisht
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=1300368827.2435.72.camel@Sudarshan.research.nokia.com \
--to=sudarshan.bisht@nokia.com \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
/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).