Browse files

audio: Replace non-portable asprintf in debug code by g_strdup_printf

sw->name already uses the correct g_free to free the allocated memory.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>
  • Loading branch information...
stweil authored and Anthony Liguori committed Jan 16, 2013
1 parent a1cbfd5 commit 457b65432700281b061086a2a8527bf1f59163a9
Showing with 3 additions and 2 deletions.
  1. +3 −2 audio/audio.c
@@ -828,8 +828,9 @@ static int audio_attach_capture (HWVoiceOut *hw)
QLIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
QLIST_INSERT_HEAD (&hw->cap_head, sc, entries);
- asprintf (&sw->name, "for %p %d,%d,%d",
- hw, sw->info.freq, sw->info.bits, sw->info.nchannels);
+ sw->name = g_strdup_printf ("for %p %d,%d,%d",
+ hw, sw->info.freq, sw->info.bits,
+ sw->info.nchannels);
dolog ("Added %s active = %d\n", sw->name, sw->active);
if (sw->active) {

0 comments on commit 457b654

Please sign in to comment.