Handle the error if malloc is failed in load_with_gd
Merge branch 'gd-integration' into release-0.20