Hi,

On Wed, 2011-09-21 at 19:22 +0200, Ille wrote:
> Looking at the RAWFILE *raw_open_file(const gchar *filename), I think
> I found a bug; if the opening of the file succeed, but mmap fail, the
> file seems to remain opened:
> 
> Here's the code:
> 
>       if ((fd = open(filename, O_RDONLY)) == -1)
>       {
>               g_free(rawfile);
>               return(NULL);
>       }
>       rawfile->map = mmap(NULL, rawfile->size, PROT_READ, MAP_SHARED,
>       fd, 0); if(rawfile->map == MAP_FAILED)
>       {
>               g_free(rawfile);
> -------------->
> |             return(NULL);
> |     }
> |
> |___ shouldn't we have "close(fd);" here?

Oh yes. Fixed in revision 4043.

> But maybe I'm wrong, as I'm not a real programer.

Me neither :)

/Brander

_______________________________________________
Rawstudio-dev mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-dev

Reply via email to