]> code.delx.au - pulseaudio/commitdiff
stream-restore: Preventative initialistion to NULL
authorColin Guthrie <cguthrie@mandriva.org>
Mon, 29 Jun 2009 18:55:34 +0000 (19:55 +0100)
committerColin Guthrie <cguthrie@mandriva.org>
Thu, 1 Oct 2009 08:08:28 +0000 (09:08 +0100)
There is not technically a bug here due to the early return and the knowledge that one of the if blocks
will definitely be run, but this makes sure we don't call free on uninitialised data or do
anything else suitibly daft. Also helps when you copy the code and change it slightly and don't realise
you've left things open...

src/modules/module-stream-restore.c

index 9b6f914308a0a71c27559c858919013de92891c1..b7b36be48e87abd8d6ecd0869a86ad99f4079b47 100644 (file)
@@ -281,8 +281,8 @@ static pa_bool_t entries_equal(const struct entry *a, const struct entry *b) {
 
 static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint32_t idx, void *userdata) {
     struct userdata *u = userdata;
-    struct entry entry, *old;
-    char *name;
+    struct entry entry, *old = NULL;
+    char *name = NULL;
     pa_datum key, data;
 
     pa_assert(c);