@JeffryBooher any reason not to move `free(buffer);` to the end of `if (buffer)` block?