Re: PATCH: 8/10: Fix misc mem leaks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 29, 2007 at 05:35:09PM +0000, Richard W.M. Jones wrote:
> Daniel P. Berrange wrote:
> >On Thu, Nov 29, 2007 at 05:28:07PM +0000, Richard W.M. Jones wrote:
> >>Daniel P. Berrange wrote:
> >>
> >>All ACKed except:
> >>
> >>Don't we need to dup these strings because the following xdr_free (in 
> >>the caller) will free them?
> >
> >No, all the params to __virRaiseError, get strdup'd inside virRaiseError
> >before being stored in the virError object.
> >
> >    /*
> >     * Save the information about the error
> >     */
> >    virResetError(to);
> >    to->conn = conn;
> >    to->dom = dom;
> >    to->net = net;
> >    to->domain = domain;
> >    to->code = code;
> >    to->message = str;
> >    to->level = level;
> >    if (str1 != NULL)
> >        to->str1 = strdup(str1);
> >    if (str2 != NULL)
> >        to->str2 = strdup(str2);
> >    if (str3 != NULL)
> >        to->str3 = strdup(str3);
> >    to->int1 = int1;
> >    to->int2 = int2;
> >
> >
> >And the 'msg' arg gets re-allocated as the va-args are procssed with
> >vsnprintf, so there's no need for the virRaiseError caller to strdup
> >stuff itself
> 
> Right you are, so +1.

Ok, this is applied.

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]