[PATCH] create a kstrdup library function