fix malloc deprication error with gcc 4.6.3 on ubuntu/fedora