test_gengrid.c: fixed memory leak spotted by coverity.
test_gengrid.c: fixed memory leak spotted by coverity.

CID 1040015, 1040014, 1040013, 1040011, 1040010.

tasn/elementary,tasn/elementary,rvandegrift/elementary,rvandegrift/elementary,FlorentRevest/Elementary,tasn/elementary,FlorentRevest/Elementary,rvandegrift/elementary,FlorentRevest/Elementary,FlorentRevest/Elementary,tasn/elementary,rvandegrift/elementary,tasn/elementary