bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: md2, md2-tests, gc-md2, gc-md2 and some gc fixes


From: Simon Josefsson
Subject: Re: md2, md2-tests, gc-md2, gc-md2 and some gc fixes
Date: Fri, 28 Oct 2005 14:12:28 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

Hi Ralf!  Thanks for comments...  answers inline.

Ralf Wildenhues <address@hidden> writes:

>> +# include <stdio.h>
>> +# include <stdint.h>
>
> AFAICS you only need stddef.h and stdio.h here.

Yup.  I also removed the stdint module dependency.

>> +Gc_rc
>> +gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
>> +{
>> +  _gc_hash_ctx *ctx;
>> +  Gc_rc rc = GC_OK;
>> +
>> +  ctx = calloc (sizeof (*ctx), 1);
>
> Return value not tested against NULL.

Fixed.

>> +  if (rc == GC_OK)
>> +    *outhandle = ctx;
>> +  else
>> +    free (ctx);
>
> I wonder whether anyone else thinks it's useful to set
>   *outhandle = NULL
> in the error case (same for the other incarnation of this function).
> Surely it's not technically necessary.

I'm not sure.  Callers shouldn't depend on that behavior, IMHO, so
we'd might as well make outhandle really is garbage.

Thanks!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]