From: Gonglei Date: Tue, 23 Jun 2015 01:01:10 +0000 (+0800) Subject: ossaudio: fix memory leak X-Git-Tag: qemu-xen-4.7.0-rc1~181^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2828a307232ffceeddec9feb6a87ac660b68b693;p=qemu-xen.git ossaudio: fix memory leak Variable "conf" going out of scope leaks the storage it points to in line 856. Signed-off-by: Gonglei Message-Id: <1435021270-7768-1-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini --- diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 11e76a15a2..7dbe3332d8 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -853,6 +853,7 @@ static void *oss_audio_init (void) if (access(conf->devpath_in, R_OK | W_OK) < 0 || access(conf->devpath_out, R_OK | W_OK) < 0) { + g_free(conf); return NULL; } return conf;