aboutsummaryrefslogtreecommitdiffstats
path: root/src/input_stream.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-26 21:02:49 +0100
committerMax Kellermann <max@duempel.org>2008-10-26 21:02:49 +0100
commitd401589edfcbabbfb5cc4256217eab4d04f34d9a (patch)
tree34a2a760f4af70329d823c0ff00ac4b429d7b49c /src/input_stream.c
parent5c19776f2fc1416dab1da2f2baae9a0c764df965 (diff)
downloadmpd-d401589edfcbabbfb5cc4256217eab4d04f34d9a.tar.gz
mpd-d401589edfcbabbfb5cc4256217eab4d04f34d9a.tar.xz
mpd-d401589edfcbabbfb5cc4256217eab4d04f34d9a.zip
input_stream: use g_free() in input_stream_close()
g_free() allows passing the NULL pointer.
Diffstat (limited to '')
-rw-r--r--src/input_stream.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/input_stream.c b/src/input_stream.c
index b19cf30a3..30fb4b27e 100644
--- a/src/input_stream.c
+++ b/src/input_stream.c
@@ -25,7 +25,7 @@
#include "input_curl.h"
#endif
-#include <stdlib.h>
+#include <glib.h>
static const struct input_plugin *const input_plugins[] = {
&input_plugin_file,
@@ -89,14 +89,11 @@ input_stream_read(struct input_stream *is, void *ptr, size_t size)
void input_stream_close(struct input_stream *is)
{
- if (is->mime)
- free(is->mime);
- if (is->meta_name)
- free(is->meta_name);
- if (is->meta_title)
- free(is->meta_title);
-
is->plugin->close(is);
+
+ g_free(is->mime);
+ g_free(is->meta_name);
+ g_free(is->meta_title);
}
bool input_stream_eof(struct input_stream *is)