]> xenbits.xensource.com Git - libvirt.git/commitdiff
virschematest: Initialize @data
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Aug 2016 10:19:44 +0000 (12:19 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Aug 2016 15:13:35 +0000 (17:13 +0200)
==8630== Invalid read of size 8
==8630==    at 0x4EA4F0F: virFree (viralloc.c:582)
==8630==    by 0x4F398F0: virXMLValidatorFree (virxml.c:1257)
==8630==    by 0x40305C: mymain (virschematest.c:191)
==8630==    by 0x405159: virTestMain (testutils.c:982)
==8630==    by 0x403553: main (virschematest.c:215)
==8630==  Address 0xcd72243 is 131 bytes inside a block of size 177 free'd
==8630==    at 0x4C2B1F0: free (vg_replace_malloc.c:473)
==8630==    by 0x4EA4F19: virFree (viralloc.c:582)
==8630==    by 0x4ED0973: virFindFileInPath (virfile.c:1646)
==8630==    by 0x405149: virTestMain (testutils.c:980)
==8630==    by 0x403553: main (virschematest.c:215)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/virschematest.c

index 45960ba2826ac918b00a880631d38372677ab996..c9cc314c62e96a7dfc85ecfe39efc4a1b65ce94a 100644 (file)
@@ -173,6 +173,8 @@ mymain(void)
     int ret = 0;
     struct testSchemaFileData data;
 
+    memset(&data, 0, sizeof(data));
+
 #define DO_TEST(sch, ...)                                                      \
     do {                                                                       \
         data.schema = sch;                                                     \