#define freeandnull(p) {free(p); p=0;}