free(buffer) in read data