diff --git a/core/cbits/grpc_haskell.c b/core/cbits/grpc_haskell.c index d383983..f707d89 100644 --- a/core/cbits/grpc_haskell.c +++ b/core/cbits/grpc_haskell.c @@ -427,7 +427,7 @@ void create_string_arg(grpc_arg* args, size_t i, grpc_arg* arg = args+i; arg->type = GRPC_ARG_STRING; arg->key = translate_arg_key(key); - char* storeValue = malloc(sizeof(char)*strlen(value)); + char* storeValue = malloc(sizeof(char)*(strlen(value)+1)); arg->value.string = strcpy(storeValue, value); }