At Wed, 4 May 2011 12:46:01 +0300, sudarshan.bisht@nokia.com wrote:
From: Sudarshan Bisht sudarshan.bisht@nokia.com
Coverity Static Analysis helps developers find hard-to-spot, yet potentially crash-causing defects early in the development phase, reducing the cost,time, and risk of software errors.
This patch has fixes for 1) a junk assignment and 2) memory freed at wrong location.
modules/mixer/simple/python.c | 1 + src/control/control_hw.c | 1 + src/mixer/mixer.c | 1 - 3 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/mixer/simple/python.c b/modules/mixer/simple/python.c index c822c52..784d9a0 100644 --- a/modules/mixer/simple/python.c +++ b/modules/mixer/simple/python.c @@ -663,6 +663,7 @@ pymixer_attach_hctl(struct pymixer *pymixer, PyObject *args) return NULL; err = snd_mixer_attach_hctl(pymixer->mixer, hctl); if (err < 0) {
PyErr_Format(PyExc_RuntimeError, "Cannot attach hctl: %s", snd_strerror(err)); return NULL; }snd_hctl_close(hctl);
This doesn't look good. We did close mistakenly in snd_mixer_attach_hctl() in the error case, and it's fixed by your patch. But this behavior shouldn't be inherited.
thanks,
Takashi