diff --git a/server/modules/routing/avrorouter/avro_client.c b/server/modules/routing/avrorouter/avro_client.c index 05b98f747..296b43fdd 100644 --- a/server/modules/routing/avrorouter/avro_client.c +++ b/server/modules/routing/avrorouter/avro_client.c @@ -853,9 +853,7 @@ GWBUF* read_avro_json_schema(const char *avrofile, const char* dir) nread--; } - buffer[nread++] = '\n'; - - GWBUF * newbuf = gwbuf_alloc_and_load(nread, buffer); + GWBUF* newbuf = gwbuf_alloc_and_load(nread, buffer); if (newbuf) { @@ -863,6 +861,8 @@ GWBUF* read_avro_json_schema(const char *avrofile, const char* dir) } } + rval = gwbuf_append(rval, gwbuf_alloc_and_load(1, "\n")); + fclose(file); } else