diff options
author | Max Kellermann <max@duempel.org> | 2009-01-25 18:47:21 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-25 18:47:21 +0100 |
commit | a45922cd66cf8a7a03905c020e50ab01dc05cfa9 (patch) | |
tree | 2171f4d74886b9d049eafe14dc2b1ce72036c912 /src/output | |
parent | 7960ad32fcfb1e17c24d3b26e53a1cdbc5ca0028 (diff) | |
download | mpd-a45922cd66cf8a7a03905c020e50ab01dc05cfa9.tar.gz mpd-a45922cd66cf8a7a03905c020e50ab01dc05cfa9.tar.xz mpd-a45922cd66cf8a7a03905c020e50ab01dc05cfa9.zip |
use g_free() instead of free()
On some platforms, g_free() must be used for memory allocated by
GLib. This patch intends to correct a lot of occurrences, but is
probably not complete.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/alsa_plugin.c | 2 | ||||
-rw-r--r-- | src/output/ao_plugin.c | 2 | ||||
-rw-r--r-- | src/output/jack_plugin.c | 8 | ||||
-rw-r--r-- | src/output/mvp_plugin.c | 2 | ||||
-rw-r--r-- | src/output/oss_plugin.c | 2 | ||||
-rw-r--r-- | src/output/osx_plugin.c | 5 | ||||
-rw-r--r-- | src/output/shout_plugin.c | 2 |
7 files changed, 11 insertions, 12 deletions
diff --git a/src/output/alsa_plugin.c b/src/output/alsa_plugin.c index 43ce99605..c26fcdf05 100644 --- a/src/output/alsa_plugin.c +++ b/src/output/alsa_plugin.c @@ -97,7 +97,7 @@ alsa_data_free(struct alsa_data *ad) { g_free(ad->device); mixer_free(ad->mixer); - free(ad); + g_free(ad); } static void diff --git a/src/output/ao_plugin.c b/src/output/ao_plugin.c index 10ce9c9de..655d267fd 100644 --- a/src/output/ao_plugin.c +++ b/src/output/ao_plugin.c @@ -131,7 +131,7 @@ audioOutputAo_initDriver(struct audio_output *ao, static void freeAoData(AoData * ad) { ao_free_options(ad->options); - free(ad); + g_free(ad); } static void audioOutputAo_finishDriver(void *data) diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c index 8e4be218d..71957c226 100644 --- a/src/output/jack_plugin.c +++ b/src/output/jack_plugin.c @@ -92,7 +92,7 @@ mpd_jack_free(struct jack_data *jd) for (unsigned i = 0; i < G_N_ELEMENTS(jd->output_ports); ++i) g_free(jd->output_ports[i]); - free(jd); + g_free(jd); } static void @@ -275,7 +275,7 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) jd->output_ports[0])) != 0 ) { g_warning("%s is not a valid Jack Client / Port", jd->output_ports[0]); - free(port_name); + g_free(port_name); return -1; } sprintf(port_name, "%s:right", name); @@ -283,10 +283,10 @@ mpd_jack_connect(struct jack_data *jd, struct audio_format *audio_format) jd->output_ports[1])) != 0 ) { g_warning("%s is not a valid Jack Client / Port", jd->output_ports[1]); - free(port_name); + g_free(port_name); return -1; } - free(port_name); + g_free(port_name); } return 1; diff --git a/src/output/mvp_plugin.c b/src/output/mvp_plugin.c index cf63faf08..7eccb23a2 100644 --- a/src/output/mvp_plugin.c +++ b/src/output/mvp_plugin.c @@ -124,7 +124,7 @@ static void *mvp_initDriver(G_GNUC_UNUSED struct audio_output *audio_output, static void mvp_finishDriver(void *data) { MvpData *md = data; - free(md); + g_free(md); } static int mvp_setPcmParams(MvpData * md, unsigned long rate, int channels, diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c index 33587be2c..c4b4698ee 100644 --- a/src/output/oss_plugin.c +++ b/src/output/oss_plugin.c @@ -292,7 +292,7 @@ static void freeOssData(OssData * od) mixer_free(od->mixer); - free(od); + g_free(od); } #define OSS_STAT_NO_ERROR 0 diff --git a/src/output/osx_plugin.c b/src/output/osx_plugin.c index 44a87f9d3..2ab0d6b0d 100644 --- a/src/output/osx_plugin.c +++ b/src/output/osx_plugin.c @@ -90,11 +90,10 @@ osx_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput, static void freeOsxData(OsxData * od) { - if (od->buffer) - free(od->buffer); + g_free(od->buffer); g_mutex_free(od->mutex); g_cond_free(od->condition); - free(od); + g_free(od); } static void osx_finishDriver(void *data) diff --git a/src/output/shout_plugin.c b/src/output/shout_plugin.c index 2217bc56e..3fc372250 100644 --- a/src/output/shout_plugin.c +++ b/src/output/shout_plugin.c @@ -81,7 +81,7 @@ static void free_shout_data(struct shout_data *sd) if (sd->timer) timer_free(sd->timer); - free(sd); + g_free(sd); } #define check_block_param(name) { \ |