Re: [HelenOS-devel] Fix memory leak about mkmfs util

2016-04-01 Thread Jakub Jermář
Hi Manuele, On 04/01/2016 09:13 AM, Manuele Conti wrote: > this is my patch file without check null pointer before free call. Fixed in mainline,2444. Thanks, Jakub > > Cheers, > Manuele > > > 2016-03-30 13:21 GMT+02:00 Manuele Conti >: > > Hi All, >

Re: [HelenOS-devel] Fix memory leak about mkmfs util

2016-04-01 Thread Manuele Conti
Hi all, this is my patch file without check null pointer before free call. Cheers, Manuele 2016-03-30 13:21 GMT+02:00 Manuele Conti : > Hi All, > I found a memory leak in a mkmfs util and I try to fix it. > > Regards, > Manuele > === modified file 'uspace/app/mkmfs/mkmfs.c' --- uspace/app/mkmfs

Re: [HelenOS-devel] Fix memory leak about mkmfs util

2016-03-31 Thread Jiri Svoboda
Lately I've adopted a style where free() and destructor functions (i.e. foo_ destroy(foo_t *foo)) are expected to be no-op for NULL pointer. It's quite useful, you just need to get used to it so that the behavior does not surprise you. So I would agree that if (p) free(p) is not needed. If found

Re: [HelenOS-devel] Fix memory leak about mkmfs util

2016-03-30 Thread Jakub Jermář
On 03/30/2016 03:54 PM, Jan Vesely wrote: > On Wed, 2016-03-30 at 13:21 +0200, Manuele Conti wrote: >> Hi All, >> I found a memory leak in a mkmfs util and I try to fix it. > > free() is NULL safe (C std 7.20.3.2, and also in HelenOS > uspace/lib/c/generic/malloc.c:972). doing: > > if (p) >

Re: [HelenOS-devel] Fix memory leak about mkmfs util

2016-03-30 Thread Manuele Conti
Hi Jan, You right tomorrow I'll resend my patch with your suggest. Many thanks, Manuele > On 30 Mar 2016, at 15:54, Jan Vesely wrote: > >> On Wed, 2016-03-30 at 13:21 +0200, Manuele Conti wrote: >> Hi All, >> I found a memory leak in a mkmfs util and I try to fix it. > > free() is NULL safe (C

Re: [HelenOS-devel] Fix memory leak about mkmfs util

2016-03-30 Thread Jan Vesely
On Wed, 2016-03-30 at 13:21 +0200, Manuele Conti wrote: > Hi All, > I found a memory leak in a mkmfs util and I try to fix it. free() is NULL safe (C std 7.20.3.2, and also in HelenOS uspace/lib/c/generic/malloc.c:972). doing: if (p) free(p); is useless. regards, Jan > > Regards, > Ma

[HelenOS-devel] Fix memory leak about mkmfs util

2016-03-30 Thread Manuele Conti
Hi All, I found a memory leak in a mkmfs util and I try to fix it. Regards, Manuele === modified file 'uspace/app/mkmfs/mkmfs.c' --- uspace/app/mkmfs/mkmfs.c 2015-08-22 05:12:30 + +++ uspace/app/mkmfs/mkmfs.c 2016-03-30 11:03:04 + @@ -639,8 +639,10 @@ ibmap_buf = malloc(ibmap_nblocks * s