[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pdf-devel] Doubt about pdf_alloc
From: |
Luca Braglia |
Subject: |
[pdf-devel] Doubt about pdf_alloc |
Date: |
Tue, 29 Dec 2009 15:31:10 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
hello *
I'm looking at the code (pdf-alloc.c); a doubt about pdf_alloc
function. bzr code is
...
pointer = malloc (size);
if (!pointer && size != 0)
{
pointer = NULL;
}
...
Control flow enter the block if pointer is already NULL, isn't
it? If so the block seems (at least to me) to be useless. Is it
a placeholder for other things yet to come?
might it be
if (pointer && size == 0)
{
pointer = NULL;
}
so that pdf_alloc handles this exception (if one ask for 0 heap
bytes) unlike classic malloc (that returns a pointer)?
many thanks and happy gnu year!
- [pdf-devel] Doubt about pdf_alloc,
Luca Braglia <=