[libvirt] [PATCH 1/2] virschematest: Initialize @data

Ján Tomko jtomko at redhat.com
Fri Aug 12 13:53:56 UTC 2016


On Fri, Aug 12, 2016 at 02:59:08PM +0200, Michal Privoznik wrote:
>==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 at redhat.com>
>---
> tests/virschematest.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/tests/virschematest.c b/tests/virschematest.c
>index 45960ba..c9cc314 100644
>--- a/tests/virschematest.c
>+++ b/tests/virschematest.c
>@@ -173,6 +173,8 @@ mymain(void)
>     int ret = 0;
>     struct testSchemaFileData data;

Could be just data = {0};

>
>+    memset(&data, 0, sizeof(data));
>+

ACK either way.

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160812/bb75803a/attachment-0001.sig>


More information about the libvir-list mailing list