linux-fs: zero packet buffer initially
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 15 Mar 2016 21:12:14 +0000 (17:12 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 18 Mar 2016 21:54:59 +0000 (17:54 -0400)
This fixes Valgrind warnings.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
platforms/linux-fs/barectf-platform-linux-fs.c

index f2b3b9b757f69edd862a57971d6c2a77fcd59600..d91b474fb31d60fd30bf9f7aa1a0359f053eedaf 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
+#include <string.h>
 #include <assert.h>
 #include <barectf.h>
 #include <time.h>
@@ -115,6 +116,8 @@ struct barectf_platform_linux_fs_ctx *barectf_platform_linux_fs_init(
                return NULL;
        }
 
+       memset(buf, 0, buf_size);
+
        sprintf(stream_path, "%s/stream", trace_dir);
        ctx->fh = fopen(stream_path, "wb");
 
This page took 0.024689 seconds and 4 git commands to generate.