get rid of pointless strdup and memleak