From 300384ce0aa79bd86cdafa88848c6e944c0353b5 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 28 Aug 2009 15:16:54 +0300 Subject: Fix checking for NULL after usage The pa_xmalloc calls oom() in case of NULL pointer returned by malloc() on one hand and dereferencing of pointer is happen early than actual check on other hand. Thus, just remove useless checks. --- src/pulsecore/sound-file-stream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/pulsecore/sound-file-stream.c') diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c index f41c53f3..c4b4d1a5 100644 --- a/src/pulsecore/sound-file-stream.c +++ b/src/pulsecore/sound-file-stream.c @@ -334,8 +334,7 @@ int pa_play_file( return 0; fail: - if (u) - file_stream_unref(u); + file_stream_unref(u); if (fd >= 0) pa_close(fd); -- cgit From 84eb6614eb3a4c72d9c529948aff8ffd4c534e19 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 28 Aug 2009 23:24:09 +0200 Subject: core: move 'flags' field into 'pa_sink_input_new_data' structure so that hooks can access it --- src/pulsecore/sound-file-stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pulsecore/sound-file-stream.c') diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c index c4b4d1a5..16de4923 100644 --- a/src/pulsecore/sound-file-stream.c +++ b/src/pulsecore/sound-file-stream.c @@ -311,7 +311,7 @@ int pa_play_file( pa_proplist_sets(data.proplist, PA_PROP_MEDIA_FILENAME, fname); pa_sndfile_init_proplist(u->sndfile, data.proplist); - pa_sink_input_new(&u->sink_input, sink->core, &data, 0); + pa_sink_input_new(&u->sink_input, sink->core, &data); pa_sink_input_new_data_done(&data); if (!u->sink_input) -- cgit