avoid a malloc(0)

This is unlikely to fix any problems, but I think malloc(0) is not
specified by C99.
This commit is contained in:
Matthew Flatt 2014-01-26 18:33:30 -07:00
parent 791ec4cfb1
commit bc018585ac
2 changed files with 2 additions and 2 deletions

View File

@ -3929,7 +3929,7 @@ static Scheme_Object *foreign_ffi_callback(int argc, Scheme_Object *argv[])
`free_cl_cif_queue_args' to clean up this extra level. */
GC_CAN_IGNORE void **tmp, *cr;
if (constant_reply) {
cr = malloc(constant_reply_size);
cr = malloc(constant_reply_size ? constant_reply_size : 1);
memcpy(cr, constant_reply, constant_reply_size);
constant_reply = cr;
}

View File

@ -3127,7 +3127,7 @@ static void free_cl_cif_queue_args(void *ignored, void *p)
`free_cl_cif_queue_args' to clean up this extra level. */
GC_CAN_IGNORE void **tmp, *cr;
if (constant_reply) {
cr = malloc(constant_reply_size);
cr = malloc(constant_reply_size ? constant_reply_size : 1);
memcpy(cr, constant_reply, constant_reply_size);
constant_reply = cr;
}