From 28b6ce39d3d88d0159b54c8ca558e993eac93056 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 24 Nov 2014 19:56:01 +0100 Subject: audio: make mp_chmap_to_str() return a stack-allocated string Simplifies memory management. --- audio/audio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'audio/audio.c') diff --git a/audio/audio.c b/audio/audio.c index 0458e813e7..2cda1ba110 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -93,10 +93,9 @@ bool mp_audio_config_valid(const struct mp_audio *mpa) char *mp_audio_fmt_to_str(int srate, const struct mp_chmap *chmap, int format) { - char *chstr = mp_chmap_to_str(chmap); - char *res = talloc_asprintf(NULL, "%dHz %s %dch %s", srate, chstr, - chmap->num, af_fmt_to_str(format)); - talloc_free(chstr); + char *res = talloc_asprintf(NULL, "%dHz %s %dch %s", srate, + mp_chmap_to_str(chmap), chmap->num, + af_fmt_to_str(format)); return res; } -- cgit v1.2.3