diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-02-05 22:05:58 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-02-05 22:05:58 +0000 |
commit | 090f1fa3237cbbc2338d29fe7ddb7d35396cddbb (patch) | |
tree | 349aa90760d5dee9e6f1ac7901ae3872d00c3ba1 /audio/audio.c | |
parent | 3ec88e80365c889f824d9a171fbf197b46a7c03f (diff) | |
download | qemu-090f1fa3237cbbc2338d29fe7ddb7d35396cddbb.zip qemu-090f1fa3237cbbc2338d29fe7ddb7d35396cddbb.tar.gz qemu-090f1fa3237cbbc2338d29fe7ddb7d35396cddbb.tar.bz2 |
audio: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6528 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'audio/audio.c')
-rw-r--r-- | audio/audio.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/audio/audio.c b/audio/audio.c index e2635c0..b0a5f3b 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -197,8 +197,8 @@ void *audio_calloc (const char *funcname, int nmemb, size_t size) 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 @@ static char *audio_alloc_prefix (const char *s) 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 @@ static void audio_process_options (const char *prefix, * 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); |