summaryrefslogtreecommitdiff
path: root/src/pulsecore
diff options
context:
space:
mode:
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>2009-08-28 15:16:54 +0300
committerLennart Poettering <lennart@poettering.net>2009-08-28 17:12:44 +0200
commit300384ce0aa79bd86cdafa88848c6e944c0353b5 (patch)
treeeb95d8af827f8aed4e3801046e4f922ff4dd59a6 /src/pulsecore
parentae383539d7001d59044e6d7e06e9270b65ae762b (diff)
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.
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/protocol-simple.c3
-rw-r--r--src/pulsecore/resampler.c3
-rw-r--r--src/pulsecore/sound-file-stream.c3
3 files changed, 3 insertions, 6 deletions
diff --git a/src/pulsecore/protocol-simple.c b/src/pulsecore/protocol-simple.c
index 95ec6ac8e..488d75721 100644
--- a/src/pulsecore/protocol-simple.c
+++ b/src/pulsecore/protocol-simple.c
@@ -627,8 +627,7 @@ void pa_simple_protocol_connect(pa_simple_protocol *p, pa_iochannel *io, pa_simp
return;
fail:
- if (c)
- connection_unlink(c);
+ connection_unlink(c);
}
void pa_simple_protocol_disconnect(pa_simple_protocol *p, pa_module *m) {
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index f1bfa156b..bed5a20df 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -299,8 +299,7 @@ pa_resampler* pa_resampler_new(
return r;
fail:
- if (r)
- pa_xfree(r);
+ pa_xfree(r);
return NULL;
}
diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c
index f41c53f3c..c4b4d1a53 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);