Re: [libvirt] [PATCH 1/3] virbuffer: Don't leak memory in virBufferAddBuffer

2019-05-03 Thread Andrea Bolognani
On Fri, 2019-05-03 at 11:57 +0200, Michal Privoznik wrote: > On 5/3/19 11:18 AM, Andrea Bolognani wrote: > > On Thu, 2019-04-18 at 14:11 +0200, Michal Privoznik wrote: > > > +if (virBufferCurrentContent(&buf1) || > > > +!virBufferCurrentContent(&buf2)) { > > > +VIR_TEST_DEBUG("U

Re: [libvirt] [PATCH 1/3] virbuffer: Don't leak memory in virBufferAddBuffer

2019-05-03 Thread Michal Privoznik
On 5/3/19 11:18 AM, Andrea Bolognani wrote: On Thu, 2019-04-18 at 14:11 +0200, Michal Privoznik wrote: If an error occurs in a virBuffer* API the idea is to free the content immediately and set @error member used in error reporting later. Well, this is not what how virBufferAddBuffer works. Sig

Re: [libvirt] [PATCH 1/3] virbuffer: Don't leak memory in virBufferAddBuffer

2019-05-03 Thread Andrea Bolognani
On Thu, 2019-04-18 at 14:11 +0200, Michal Privoznik wrote: > If an error occurs in a virBuffer* API the idea is to free the > content immediately and set @error member used in error reporting > later. Well, this is not what how virBufferAddBuffer works. > > Signed-off-by: Michal Privoznik > --- >

Re: [libvirt] [PATCH 1/3] virbuffer: Don't leak memory in virBufferAddBuffer

2019-05-03 Thread Michal Privoznik
On 5/3/19 10:40 AM, Erik Skultety wrote: On Thu, Apr 18, 2019 at 02:11:23PM +0200, Michal Privoznik wrote: If an error occurs in a virBuffer* API the idea is to free the content immediately and set @error member used in error reporting later. Well, this is not what how virBufferAddBuffer works.

Re: [libvirt] [PATCH 1/3] virbuffer: Don't leak memory in virBufferAddBuffer

2019-05-03 Thread Erik Skultety
On Thu, Apr 18, 2019 at 02:11:23PM +0200, Michal Privoznik wrote: > If an error occurs in a virBuffer* API the idea is to free the > content immediately and set @error member used in error reporting > later. Well, this is not what how virBufferAddBuffer works. > > Signed-off-by: Michal Privoznik >

[libvirt] [PATCH 1/3] virbuffer: Don't leak memory in virBufferAddBuffer

2019-04-18 Thread Michal Privoznik
If an error occurs in a virBuffer* API the idea is to free the content immediately and set @error member used in error reporting later. Well, this is not what how virBufferAddBuffer works. Signed-off-by: Michal Privoznik --- src/util/virbuffer.c | 2 +- tests/virbuftest.c | 32 +++