sparsefile: Initialize memory in unit test to make valgrind happy
authorSebastian Dröge <sebastian@centricular.com>
Sun, 29 Jun 2014 17:16:05 +0000 (19:16 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sun, 29 Jun 2014 17:16:05 +0000 (19:16 +0200)
We were writing unitialized stack memory to the file.

tests/check/libs/sparsefile.c

index 6d291b4..fd5c81e 100644 (file)
@@ -59,7 +59,7 @@ expect_write (GstSparseFile * file, gsize offset, gsize count, gsize result,
     gsize avail)
 {
   GError *error = NULL;
-  gchar buffer[200];
+  gchar buffer[200] = { 0, };
   gsize res, a;
 
   res = gst_sparse_file_write (file, offset, buffer, count, &a, &error);