<html><body>
<p>+1<br>
<br>
Sharad Mishra<br>
Open Virtualization<br>
Linux Technology Center<br>
IBM<br>
<br>
<tt>libvirt-cim-bounces@redhat.com wrote on 08/10/2011 10:08:29 PM:<br>
<br>
> Wayne Xia <xiawenc@linux.vnet.ibm.com> </tt><br>
<tt>> Sent by: libvirt-cim-bounces@redhat.com<br>
> </tt><br>
<tt>> 08/10/11 10:08 PM</tt><br>
<tt>> <br>
> Please respond to<br>
> List for discussion and development of libvirt CIM <libvirt-cim@redhat.com></tt><br>
<tt>> <br>
> To</tt><br>
<tt>> <br>
> List for discussion and development of libvirt CIM <libvirt-cim@redhat.com></tt><br>
<tt>> <br>
> cc</tt><br>
<tt>> <br>
> Subject</tt><br>
<tt>> <br>
> Re: [Libvirt-cim] [PATCH] VirtualSystemManagementService: Fixing <br>
> potential null dereferences and leaks</tt><br>
<tt>> <br>
> Seems fine, +1<br>
> <br>
> $BP2(B 2011-8-11 3:53, Eduardo Lima (Etrunko) $B<LF;(B:<br>
> > # HG changeset patch<br>
> > # User Eduardo Lima (Etrunko)<eblima@br.ibm.com><br>
> > # Date 1312918075 10800<br>
> > # Node ID 8759e60c17c42101118f914215d071138340c70f<br>
> > # Parent  0291fb05e93a0cbcbf2b80c894a47d58f7c37d23<br>
> > VirtualSystemManagementService: Fixing potential null dereferencesand leaks<br>
> ><br>
> > As reported in <a href="https://bugzilla.redhat.com/show_bug.cgi?id=728245">https://bugzilla.redhat.com/show_bug.cgi?id=728245</a><br>
> ><br>
> > line 1048 - Comparing "path" to null implies that "path" might be null.<br>
> > line 1057 - Dereferencing null variable "path".<br>
> > line 1088 - Comparing "port" to null implies that "port" might be null.<br>
> > line 1094 - Dereferencing null variable "port".<br>
> ><br>
> > Signed-off-by: Eduardo Lima (Etrunko)<eblima@br.ibm.com><br>
> ><br>
> > diff --git a/src/Virt_VirtualSystemManagementService.c b/src/<br>
> Virt_VirtualSystemManagementService.c<br>
> > --- a/src/Virt_VirtualSystemManagementService.c<br>
> > +++ b/src/Virt_VirtualSystemManagementService.c<br>
> > @@ -1054,8 +1054,12 @@<br>
> >           ret = 1;<br>
> ><br>
> >    out:<br>
> > -        CU_DEBUG("Exiting parse_console_address, ip is %s, port is %s",<br>
> > -               *path, *port);<br>
> > +        free(tmp_path);<br>
> > +        free(tmp_port);<br>
> > +<br>
> > +        if (path&&  port)<br>
> > +                CU_DEBUG("Exiting parse_console_address, ip is %<br>
> s, port is %s",<br>
> > +                       *path, *port);<br>
> ><br>
> >           return ret;<br>
> >   }<br>
> > @@ -1091,8 +1095,12 @@<br>
> >           ret = 1;<br>
> ><br>
> >    out:<br>
> > -        CU_DEBUG("Exiting parse_vnc_address, ip is %s, port is %s",<br>
> > -                *ip, *port);<br>
> > +        free(tmp_ip);<br>
> > +        free(tmp_port);<br>
> > +<br>
> > +        if (ip&&  port)<br>
> > +                CU_DEBUG("Exiting parse_vnc_address, ip is %s, port is %s",<br>
> > +                        *ip, *port);<br>
> ><br>
> >           return ret;<br>
> >   }<br>
> ><br>
> > _______________________________________________<br>
> > Libvirt-cim mailing list<br>
> > Libvirt-cim@redhat.com<br>
> > <a href="https://www.redhat.com/mailman/listinfo/libvirt-cim">https://www.redhat.com/mailman/listinfo/libvirt-cim</a><br>
> <br>
> <br>
> -- <br>
> Best Regards<br>
> <br>
> Wayne Xia<br>
> mail:xiawenc@linux.vnet.ibm.com<br>
> tel:86-010-82450803<br>
> <br>
> _______________________________________________<br>
> Libvirt-cim mailing list<br>
> Libvirt-cim@redhat.com<br>
> <a href="https://www.redhat.com/mailman/listinfo/libvirt-cim">https://www.redhat.com/mailman/listinfo/libvirt-cim</a></tt></body></html>