>>410
> buff=(char *)realloc(buff, sizeof(char) * 20);という具合に。
出たよ。メモリ確保できないときにリークが確定するパターン。
初心者に realloc() 教えるとすぐこれをやらかす。