--- a/src/c2html.c Sun Apr 19 10:48:00 2015 +0200 +++ b/src/c2html.c Tue Apr 21 09:47:52 2015 +0200 @@ -44,7 +44,8 @@ l[width] = 0; if (inputfile->count >= inputfile->capacity) { inputfile->capacity <<= 1; - inputfile->lines = realloc(inputfile->lines, inputfile->capacity); + inputfile->lines = realloc(inputfile->lines, + sizeof(char*)*inputfile->capacity); } inputfile->lines[inputfile->count] = l; inputfile->maxlinewidth = @@ -286,6 +287,7 @@ (fmt_write_func)fwrite, fout, settings.showlinenumbers); + freeinputfilebuffer(inputfile); } else { perror("Error opening input file"); retcode = -1;