[pulseaudio-discuss] [PATCH 2/2] card: Use pa_xnew0 when creating a card

David Henningsson david.henningsson at canonical.com
Mon Sep 28 05:39:31 PDT 2015


Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
 src/pulsecore/card.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index 6f9391e..7f6d255 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -135,7 +135,7 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
     pa_assert(data->profiles);
     pa_assert(!pa_hashmap_isempty(data->profiles));
 
-    c = pa_xnew(pa_card, 1);
+    c = pa_xnew0(pa_card, 1);
 
     if (!(name = pa_namereg_register(core, data->name, PA_NAMEREG_CARD, c, data->namereg_fail))) {
         pa_xfree(c);
@@ -172,9 +172,6 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
     PA_HASHMAP_FOREACH(port, c->ports, state)
         port->card = c;
 
-    c->active_profile = NULL;
-    c->save_profile = false;
-
     if (data->active_profile)
         if ((c->active_profile = pa_hashmap_get(c->profiles, data->active_profile)))
             c->save_profile = data->save_profile;
@@ -196,9 +193,6 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
         pa_assert(c->active_profile);
     }
 
-    c->userdata = NULL;
-    c->set_profile = NULL;
-
     pa_device_init_description(c->proplist, c);
     pa_device_init_icon(c->proplist, true);
     pa_device_init_intended_roles(c->proplist);
-- 
1.9.1



More information about the pulseaudio-discuss mailing list