Christian -
If you pass in a NULL ptr, but with a size, it acts as a malloc. From the
man page:
If ptr is NULL, then the call is equivalent to
malloc(size), for all values of size; if size is equal to zero, and
ptr is not NULL, then the call is equivalent to
free(ptr).
Not a good patch imo.
donald
On Tue, May 3, 2016 at 12:57 PM, Christian Franke <
[email protected]> wrote:
> From: Christian Franke <[email protected]>
>
> This branch will never be taken since ptr == NULL leads to return
> in the earlier code.
>
> Signed-off-by: Christian Franke <[email protected]>
> ---
> lib/memory.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/lib/memory.c b/lib/memory.c
> index 269520d..f17903e 100644
> --- a/lib/memory.c
> +++ b/lib/memory.c
> @@ -114,8 +114,6 @@ zrealloc (int type, void *ptr, size_t size)
> memory = realloc (ptr, size);
> if (memory == NULL)
> zerror ("realloc", type, size);
> - if (ptr == NULL)
> - alloc_inc (type);
>
> return memory;
> }
> --
> 2.8.0
>
>
> _______________________________________________
> Quagga-dev mailing list
> [email protected]
> https://lists.quagga.net/mailman/listinfo/quagga-dev
>
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev