[gambit-list] Allocate Scheme vector before or after C call?

Marc Feeley feeley at iro.umontreal.ca
Mon Jul 20 12:41:32 EDT 2020


> On Jul 20, 2020, at 11:59 AM, Marc Feeley <feeley at iro.umontreal.ca> wrote:
> 
>    } else {
>      if (buf != buffer) free(buf);
>      return ___FIX(___ERRNO_ERR(errno));
>    }

Small bug here… need to call ___ERRNO_ERR(errno) before the call to free in case free modifies errno…  The error handling could also be improved to do the “if (buf != buffer) free(buf);” in fewer places.

Marc





More information about the Gambit-list mailing list