]> code.delx.au - pulseaudio/commitdiff
bluetooth: Fix using garbage memory
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Fri, 31 Aug 2012 10:50:58 +0000 (12:50 +0200)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Wed, 26 Sep 2012 11:27:14 +0000 (19:27 +0800)
module-bluetooth-policy should set the allocated memory to zero, in
order to handle failure cases properly.

src/modules/bluetooth/module-bluetooth-policy.c

index 03beeb2446220b95483ddb26382b9e9450a5e5fb..cc12014602b924cb55d4b3ac25ef8a88c0a29ba0 100644 (file)
@@ -143,7 +143,7 @@ int pa__init(pa_module *m) {
         return -1;
     }
 
-    m->userdata = u = pa_xnew(struct userdata, 1);
+    m->userdata = u = pa_xnew0(struct userdata, 1);
 
     u->enable_a2dp_source = TRUE;
     if (pa_modargs_get_value_boolean(ma, "a2dp_source", &u->enable_a2dp_source) < 0) {