malloc rework no longer causing invalid write/read
malloc no longer causing read/write problem