From 46091a9237f17f4295dca7140d8d70b4fce8b357 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 4 Aug 2004 16:39:30 +0000 Subject: introduce pa_xmalloc() and friends implement module auto loading git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@103 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/sink-input.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'polyp/sink-input.c') diff --git a/polyp/sink-input.c b/polyp/sink-input.c index 25d8022f..04a2f020 100644 --- a/polyp/sink-input.c +++ b/polyp/sink-input.c @@ -30,6 +30,7 @@ #include "sink-input.h" #include "sample-util.h" +#include "xmalloc.h" #define CONVERT_BUFFER_LENGTH 4096 @@ -44,9 +45,8 @@ struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, con if (!(resampler = pa_resampler_new(spec, &s->sample_spec))) return NULL; - i = malloc(sizeof(struct pa_sink_input)); - assert(i); - i->name = name ? strdup(name) : NULL; + i = pa_xmalloc(sizeof(struct pa_sink_input)); + i->name = pa_xstrdup(name); i->client = NULL; i->owner = NULL; i->sink = s; @@ -88,8 +88,8 @@ void pa_sink_input_free(struct pa_sink_input* i) { if (i->resampler) pa_resampler_free(i->resampler); - free(i->name); - free(i); + pa_xfree(i->name); + pa_xfree(i); } void pa_sink_input_kill(struct pa_sink_input*i) { -- cgit