use gt_malloc() where possible
Merge pull request #85 from satta/mallocs

use gt_malloc() where possible
get rid of compiler warning (gcc 4.8.1)