
+1 Sharad Mishra Open Virtualization Linux Technology Center IBM libvirt-cim-bounces@redhat.com wrote on 01/18/2012 08:06:11 AM:
"Eduardo Lima (Etrunko)" <eblima@linux.vnet.ibm.com> Sent by: libvirt-cim-bounces@redhat.com
01/18/2012 08:06 AM
Please respond to List for discussion and development of libvirt CIM <libvirt-cim@redhat.com>
To
libvirt-cim@redhat.com
cc
"Eduardo Lima \(Etrunko\)" <eblima@br.ibm.com>
Subject
[Libvirt-cim] [PATCH 3/4] xml_parse_test: Fix invalid dereference
From: "Eduardo Lima (Etrunko)" <eblima@br.ibm.com>
As revealed by recent Coverity scan report provided by Red Hat: https://bugzilla.redhat.com/show_bug.cgi?id=750418 https://bugzilla.redhat.com/attachment.cgi?id=552325
Error: USE_AFTER_FREE: xml_parse_test.c:239: freed_arg: "free" frees "xml". xml_parse_test.c:242: pass_freed_arg: Passing freed pointer "xml" as an argument to function "printf".
Signed-off-by: Eduardo Lima (Etrunko) <eblima@br.ibm.com> --- libxkutil/xml_parse_test.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/libxkutil/xml_parse_test.c b/libxkutil/xml_parse_test.c index 16ceefb..384593d 100644 --- a/libxkutil/xml_parse_test.c +++ b/libxkutil/xml_parse_test.c @@ -236,11 +236,10 @@ static int dominfo_from_file(const char *fname, struct domain **d)
ret = get_dominfo_from_xml(xml, d);
+ printf("XML:\n%s", xml); free(xml); fclose(file);
- printf("XML:\n%s", xml); - return ret; }
-- 1.7.7.5
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim