From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVCMD-0005rU-Gz for qemu-devel@nongnu.org; Thu, 05 Feb 2009 17:06:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVCMC-0005r1-Vy for qemu-devel@nongnu.org; Thu, 05 Feb 2009 17:06:01 -0500 Received: from [199.232.76.173] (port=44911 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVCMC-0005qw-Lk for qemu-devel@nongnu.org; Thu, 05 Feb 2009 17:06:00 -0500 Received: from savannah.gnu.org ([199.232.41.3]:35487 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVCMB-0002Qs-UG for qemu-devel@nongnu.org; Thu, 05 Feb 2009 17:06:00 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LVCMA-0007h9-Vx for qemu-devel@nongnu.org; Thu, 05 Feb 2009 22:05:59 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LVCMA-0007h5-PP for qemu-devel@nongnu.org; Thu, 05 Feb 2009 22:05:58 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 05 Feb 2009 22:05:58 +0000 Subject: [Qemu-devel] [6528] audio: remove error handling from qemu_malloc() callers (Avi Kivity) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6528 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6528 Author: aliguori Date: 2009-02-05 22:05:58 +0000 (Thu, 05 Feb 2009) Log Message: ----------- audio: remove error handling from qemu_malloc() callers (Avi Kivity) Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/audio/audio.c trunk/audio/wavcapture.c Modified: trunk/audio/audio.c =================================================================== --- trunk/audio/audio.c 2009-02-05 22:05:53 UTC (rev 6527) +++ trunk/audio/audio.c 2009-02-05 22:05:58 UTC (rev 6528) @@ -197,8 +197,8 @@ static char *audio_alloc_prefix (const char *s) { const char qemu_prefix[] = "QEMU_"; - size_t len; - char *r; + size_t len, i; + char *r, *u; if (!s) { return NULL; @@ -207,17 +207,15 @@ len = strlen (s); r = qemu_malloc (len + sizeof (qemu_prefix)); - if (r) { - size_t i; - char *u = r + sizeof (qemu_prefix) - 1; + u = r + sizeof (qemu_prefix) - 1; - pstrcpy (r, len + sizeof (qemu_prefix), qemu_prefix); - pstrcat (r, len + sizeof (qemu_prefix), s); + pstrcpy (r, len + sizeof (qemu_prefix), qemu_prefix); + pstrcat (r, len + sizeof (qemu_prefix), s); - for (i = 0; i < len; ++i) { - u[i] = qemu_toupper(u[i]); - } + for (i = 0; i < len; ++i) { + u[i] = qemu_toupper(u[i]); } + return r; } @@ -460,11 +458,6 @@ * sizeof) */ optlen = len + preflen + sizeof (qemu_prefix) + 1; optname = qemu_malloc (optlen); - if (!optname) { - dolog ("Could not allocate memory for option name `%s'\n", - opt->name); - continue; - } pstrcpy (optname, optlen, qemu_prefix); Modified: trunk/audio/wavcapture.c =================================================================== --- trunk/audio/wavcapture.c 2009-02-05 22:05:53 UTC (rev 6527) +++ trunk/audio/wavcapture.c 2009-02-05 22:05:58 UTC (rev 6528) @@ -120,11 +120,6 @@ ops.destroy = wav_destroy; wav = qemu_mallocz (sizeof (*wav)); - if (!wav) { - term_printf ("Could not allocate memory for wav capture (%zu bytes)", - sizeof (*wav)); - return -1; - } shift = bits16 + stereo; hdr[34] = bits16 ? 0x10 : 0x08;