From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvMDM-0000Dr-8B for qemu-devel@nongnu.org; Fri, 13 Jun 2014 03:48:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvMDG-0007Be-4F for qemu-devel@nongnu.org; Fri, 13 Jun 2014 03:47:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvMDF-0007BV-Si for qemu-devel@nongnu.org; Fri, 13 Jun 2014 03:47:50 -0400 Message-ID: <539AAC98.8010902@redhat.com> Date: Fri, 13 Jun 2014 09:47:36 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1402624000-4896-1-git-send-email-arei.gonglei@huawei.com> <87vbs5s2kc.fsf@blackfin.pond.sub.org> In-Reply-To: <87vbs5s2kc.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , arei.gonglei@huawei.com Cc: luonengjun@huawei.com, weidong.huang@huawei.com, qemu-devel@nongnu.org, stefanha@redhat.com, kraxel@redhat.com Il 13/06/2014 09:15, Markus Armbruster ha scritto: > I'm afraid this is not an improvement. > > Your patch makes the code ignore fclose() failure silently. This is a > common mistake. fclose() failure after write can mean data loss, and > the user certainly needs to know about that. If you want that, the best solution is to first fflush() and then fclose(). Then you're sure that the fclose() doesn't cause data loss and you can safely ignore its result (it shouldn't fail). Paolo