server: fixed bad pointer in for loop causing segmentation fault