seg fault fix  for c json processing in c