diff options
author | Max Kellermann <max@duempel.org> | 2010-09-23 08:49:21 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-09-23 08:49:21 +0200 |
commit | 635cfbae131b323b62ca50c6bffb0b801b57aafe (patch) | |
tree | 6a587c6b95ea79d64694f08efa74c86304f91639 /src/decoder_control.c | |
parent | 922e51e8a94de09ceec37bc6d26a0802de2e75d7 (diff) | |
download | mpd-635cfbae131b323b62ca50c6bffb0b801b57aafe.tar.gz mpd-635cfbae131b323b62ca50c6bffb0b801b57aafe.tar.xz mpd-635cfbae131b323b62ca50c6bffb0b801b57aafe.zip |
decoder_control: use g_free() to manage mixramp allocations
Be consistent with the rest of MPD, and don't use the non-portable
header "malloc.h".
Diffstat (limited to 'src/decoder_control.c')
-rw-r--r-- | src/decoder_control.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/decoder_control.c b/src/decoder_control.c index 9a1d9abfb..224abbf31 100644 --- a/src/decoder_control.c +++ b/src/decoder_control.c @@ -22,7 +22,6 @@ #include "player_control.h" #include <assert.h> -#include <malloc.h> #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "decoder_control" @@ -50,12 +49,9 @@ dc_deinit(struct decoder_control *dc) { g_cond_free(dc->cond); g_mutex_free(dc->mutex); - if (dc->mixramp_start) - free(dc->mixramp_start); - if (dc->mixramp_end) - free(dc->mixramp_end); - if (dc->mixramp_prev_end) - free(dc->mixramp_prev_end); + g_free(dc->mixramp_start); + g_free(dc->mixramp_end); + g_free(dc->mixramp_prev_end); dc->mixramp_start = NULL; dc->mixramp_end = NULL; dc->mixramp_prev_end = NULL; @@ -172,8 +168,7 @@ dc_mixramp_start(struct decoder_control *dc, char *mixramp_start) { assert(dc != NULL); - if (dc->mixramp_start) - free(dc->mixramp_start); + g_free(dc->mixramp_start); dc->mixramp_start = mixramp_start; g_debug("mixramp_start = %s", mixramp_start ? mixramp_start : "NULL"); } @@ -183,8 +178,7 @@ dc_mixramp_end(struct decoder_control *dc, char *mixramp_end) { assert(dc != NULL); - if (dc->mixramp_end) - free(dc->mixramp_end); + g_free(dc->mixramp_end); dc->mixramp_end = mixramp_end; g_debug("mixramp_end = %s", mixramp_end ? mixramp_end : "NULL"); } @@ -194,8 +188,7 @@ dc_mixramp_prev_end(struct decoder_control *dc, char *mixramp_prev_end) { assert(dc != NULL); - if (dc->mixramp_prev_end) - free(dc->mixramp_prev_end); + g_free(dc->mixramp_prev_end); dc->mixramp_prev_end = mixramp_prev_end; g_debug("mixramp_prev_end = %s", mixramp_prev_end ? mixramp_prev_end : "NULL"); } |