Horray C memory allocation!
Because I didn't initialize bufsize properly before calling getline() it was realloc()ing my buffer and confusing free()