summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2011-08-13 13:43:20 +0200
committerColin Guthrie <colin@mageia.org>2011-08-15 09:41:56 +0100
commit92219b01b9c847af762a3a68ae538c0200bff2f8 (patch)
tree04fc69ba639cc3f2ecba706a977f1f2f96b566fd
parent3b76d8065f1ddf67939811d558660635c8143425 (diff)
Initialise variables
These were detected using clang static analyzer.
-rw-r--r--src/modules/bluetooth/bluetooth-util.c4
-rw-r--r--src/modules/module-esound-compat-spawnfd.c3
-rw-r--r--src/modules/module-native-protocol-fd.c4
-rw-r--r--src/modules/module-null-source.c1
-rw-r--r--src/pulsecore/protocol-native.c3
5 files changed, 9 insertions, 6 deletions
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index b24fe7a3..4b85ce9b 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -916,7 +916,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
} else if (dbus_message_is_signal(m, "org.bluez.MediaTransport", "PropertyChanged")) {
pa_bluetooth_device *d;
- pa_bluetooth_transport *t;
+ pa_bluetooth_transport *t = NULL;
void *state = NULL;
DBusMessageIter arg_i;
@@ -1112,7 +1112,7 @@ static DBusMessage *endpoint_set_configuration(DBusConnection *conn, DBusMessage
const char *path, *dev_path = NULL, *uuid = NULL;
uint8_t *config = NULL;
int size = 0;
- pa_bool_t nrec;
+ pa_bool_t nrec = FALSE;
enum profile p;
DBusMessageIter args, props;
DBusMessage *r;
diff --git a/src/modules/module-esound-compat-spawnfd.c b/src/modules/module-esound-compat-spawnfd.c
index 617d5a14..e2488fc6 100644
--- a/src/modules/module-esound-compat-spawnfd.c
+++ b/src/modules/module-esound-compat-spawnfd.c
@@ -47,7 +47,8 @@ static const char* const valid_modargs[] = {
int pa__init(pa_module*m) {
pa_modargs *ma = NULL;
- int ret = -1, fd = -1;
+ int ret = -1;
+ int32_t fd = -1;
char x = 1;
pa_assert(m);
diff --git a/src/modules/module-native-protocol-fd.c b/src/modules/module-native-protocol-fd.c
index eed0505b..7021a26b 100644
--- a/src/modules/module-native-protocol-fd.c
+++ b/src/modules/module-native-protocol-fd.c
@@ -48,7 +48,7 @@ static const char* const valid_modargs[] = {
int pa__init(pa_module*m) {
pa_iochannel *io;
pa_modargs *ma;
- int32_t fd;
+ int32_t fd = -1;
int r = -1;
pa_native_options *options = NULL;
@@ -59,7 +59,7 @@ int pa__init(pa_module*m) {
goto finish;
}
- if (pa_modargs_get_value_s32(ma, "fd", &fd) < 0) {
+ if (pa_modargs_get_value_s32(ma, "fd", &fd) < 0 || fd < 0) {
pa_log("Invalid file descriptor.");
goto finish;
}
diff --git a/src/modules/module-null-source.c b/src/modules/module-null-source.c
index b2981c34..b3ece7b4 100644
--- a/src/modules/module-null-source.c
+++ b/src/modules/module-null-source.c
@@ -192,6 +192,7 @@ int pa__init(pa_module*m) {
}
ss = m->core->default_sample_spec;
+ map = m->core->default_channel_map;
if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, PA_CHANNEL_MAP_DEFAULT) < 0) {
pa_log("Invalid sample format specification or channel map");
goto fail;
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 3ed9f1a9..c71345e9 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1061,7 +1061,8 @@ static playback_stream* playback_stream_new(
/* Note: This function takes ownership of the 'formats' param, so we need
* to take extra care to not leak it */
- playback_stream *s, *ssync;
+ playback_stream *ssync;
+ playback_stream *s = NULL;
pa_sink_input *sink_input = NULL;
pa_memchunk silence;
uint32_t idx;