fixed issue 2413: sg_malloc in graph cut
Merge pull request #2414 from Jiaolong/graph_cut_2413

fixed issue 2413: sg_malloc in graph cut