Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't try to allocate 0 bytes in CStruct REPR.
  • Loading branch information
jnthn committed Apr 15, 2012
1 parent e49a91d commit 3a23406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/6model/reprs/CStruct.c
Expand Up @@ -340,7 +340,7 @@ static void initialize(PARROT_INTERP, STable *st, void *data) {

/* Allocate object body. */
CStructBody *body = (CStructBody *)data;
body->cstruct = mem_sys_allocate(repr_data->struct_size);
body->cstruct = mem_sys_allocate(repr_data->struct_size > 0 ? repr_data->struct_size : 1);
memset(body->cstruct, 0, repr_data->struct_size);

/* Initialize the slots. */
Expand Down

0 comments on commit 3a23406

Please sign in to comment.