[Gluster-devel] Unchecked mallocs in libglusterfs

Anand Avati avati at zresearch.com
Tue Jan 15 00:46:21 UTC 2008


Hey Jonathan,
 Yes, there are a few unchecked mallocs in libglusterfs. The cleanup has
been pending for a while and will soon happen. If you already have a diff
against them, it will be appreciated if you can post it. Even otherwise the
next cleanup cycle is going to fix them.

avati

2008/1/1, Jonathan Bringhurst <fintler at gmail.com>:
>
> Hey everyone,
>
> This is my first time posting to the list and (as a disclaimer) I'm
> generally a newbie to glusterfs and filesystems in general. I was
> recently poking through the source (in the glusterfs-1.3.7 tarball)
> and noticed a few unchecked mallocs. Here's a few examples...
>
> **************************************
> libglusterfs/src/common-utils.h:105
>
>   struct iovec *newvec = malloc (bytecount);
>
>   for (i=0;i<count;i++) {
>     newvec[i].iov_len = vector[i].iov_len;
>
> **************************************
> libglusterfs/src/common-utils.h:169
>
>   void *newptr = malloc (size);
>   memcpy (newptr, ptr, size);
>
> Is there any plan in place to get these cleaned up? I'd be happy to
> create a nice diff, I'm just unsure as how to proceed. Are there
> syscall wrappers located somewhere in the code base? Should I change
> them to x*alloc? Any suggestions on the matter would be appreciated.
>
> -Jon Bringhurst <fintler at gmail.com>
>
> P.S. My current motivation on this is to become more familiar with the
> codebase in general before I attempt to implement my (super secret)
> idea for a translator ;)
>
>
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at nongnu.org
> http://lists.nongnu.org/mailman/listinfo/gluster-devel
>



-- 
If I traveled to the end of the rainbow
As Dame Fortune did intend,
Murphy would be there to tell me
The pot's at the other end.



More information about the Gluster-devel mailing list