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/source-output.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'polyp/source-output.c') diff --git a/polyp/source-output.c b/polyp/source-output.c index 2705fdb3..07901fa8 100644 --- a/polyp/source-output.c +++ b/polyp/source-output.c @@ -28,6 +28,7 @@ #include #include "source-output.h" +#include "xmalloc.h" struct pa_source_output* pa_source_output_new(struct pa_source *s, const char *name, const struct pa_sample_spec *spec) { struct pa_source_output *o; @@ -39,9 +40,8 @@ struct pa_source_output* pa_source_output_new(struct pa_source *s, const char *n if (!(resampler = pa_resampler_new(&s->sample_spec, spec))) return NULL; - o = malloc(sizeof(struct pa_source_output)); - assert(o); - o->name = name ? strdup(name) : NULL; + o = pa_xmalloc(sizeof(struct pa_source_output)); + o->name = pa_xstrdup(name); o->client = NULL; o->owner = NULL; o->source = s; @@ -71,8 +71,8 @@ void pa_source_output_free(struct pa_source_output* o) { if (o->resampler) pa_resampler_free(o->resampler); - free(o->name); - free(o); + pa_xfree(o->name); + pa_xfree(o); } void pa_source_output_kill(struct pa_source_output*i) { -- cgit