[bugfix] allocate size was inefficient
[bugfix] glibc's getenv function does not igrore trailing '='