summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2011-08-13 13:43:19 +0200
committerColin Guthrie <colin@mageia.org>2011-08-15 09:41:56 +0100
commit3b76d8065f1ddf67939811d558660635c8143425 (patch)
tree3385894bc4e4b8e56f46cef292b082941aa24c1e
parent1e4298be4d7c5447699eaa93487bceecfc58cea5 (diff)
Plug some memory leaks
These were detected with valgrind.
-rw-r--r--src/modules/jack/module-jackdbus-detect.c1
-rw-r--r--src/modules/module-device-manager.c7
-rw-r--r--src/modules/module-virtual-source.c2
-rw-r--r--src/modules/raop/raop_client.c2
4 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/jack/module-jackdbus-detect.c b/src/modules/jack/module-jackdbus-detect.c
index 864f96b1..6bbf38b6 100644
--- a/src/modules/jack/module-jackdbus-detect.c
+++ b/src/modules/jack/module-jackdbus-detect.c
@@ -231,6 +231,7 @@ int pa__init(pa_module *m) {
pa_log("Failed to parse connect= argument.");
goto fail;
}
+ pa_modargs_free(ma);
if (!(connection = pa_dbus_bus_get(m->core, DBUS_BUS_SESSION, &error)) || dbus_error_is_set(&error)) {
diff --git a/src/modules/module-device-manager.c b/src/modules/module-device-manager.c
index 67baef31..34e653ec 100644
--- a/src/modules/module-device-manager.c
+++ b/src/modules/module-device-manager.c
@@ -199,6 +199,7 @@ static void entry_free(struct entry* e) {
pa_xfree(e->description);
pa_xfree(e->icon);
+ pa_xfree(e);
}
static pa_bool_t entry_write(struct userdata *u, const char *name, const struct entry *e) {
@@ -769,8 +770,6 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
t != (PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE))
return;
- entry = entry_new();
-
if ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK_INPUT) {
pa_sink_input *si;
@@ -801,6 +800,7 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
if (!(sink = pa_idxset_get_by_index(c->sinks, idx)))
return;
+ entry = entry_new();
name = pa_sprintf_malloc("sink:%s", sink->name);
old = load_or_initialize_entry(u, entry, name, "sink:");
@@ -830,6 +830,7 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
if (source->monitor_of)
return;
+ entry = entry_new();
name = pa_sprintf_malloc("source:%s", source->name);
old = load_or_initialize_entry(u, entry, name, "source:");
@@ -847,6 +848,8 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
pa_xfree(entry->icon);
entry->icon = pa_xstrdup(pa_proplist_gets(source->proplist, PA_PROP_DEVICE_ICON_NAME));
+ } else {
+ pa_assert_not_reached();
}
pa_assert(name);
diff --git a/src/modules/module-virtual-source.c b/src/modules/module-virtual-source.c
index 70e327ba..7530975e 100644
--- a/src/modules/module-virtual-source.c
+++ b/src/modules/module-virtual-source.c
@@ -661,6 +661,7 @@ int pa__init(pa_module*m) {
u->sink_memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, pa_frame_size(&ss), 1, 1, 0, NULL);
if (!u->sink_memblockq) {
+ pa_sink_new_data_done(&sink_data);
pa_log("Failed to create sink memblockq.");
goto fail;
}
@@ -689,6 +690,7 @@ int pa__init(pa_module*m) {
pa_sink_put(u->sink);
} else {
+ pa_sink_new_data_done(&sink_data);
/* optional uplink sink not enabled */
u->sink = NULL;
}
diff --git a/src/modules/raop/raop_client.c b/src/modules/raop/raop_client.c
index cba7af9a..118b9d9e 100644
--- a/src/modules/raop/raop_client.c
+++ b/src/modules/raop/raop_client.c
@@ -385,6 +385,8 @@ void pa_raop_client_free(pa_raop_client* c) {
if (c->rtsp)
pa_rtsp_client_free(c->rtsp);
+ if (c->sid)
+ pa_xfree(c->sid);
pa_xfree(c->host);
pa_xfree(c);
}