Io proverei con una funzione wrapper, che tiene il conto della profondità.
Non l'ho messa sul compilatore, ma ragionevolmente dovrebbe funzionare.
void dealloca(TreeNodePtr *t) {
    if(*t != NULL) {
        dealloca(&(*t)->sx);
        dealloca(&(*t)->dx);
    }
    free(*t);
}
void pota(TeeNodePtr *t, int h) {
    int profondita = 0;
    potasottoalbero(&t, h, &profondità);
}
void potasottoalbero(TreeNodePtr *t, int h, int *profondita) {
    if((*profondita)==h) {
        dealloca(&(*t)->sx);
        dealloca(&(*t)->dx);
        return;
    }
    *profondita++;
    potasottoalbero(&(*t)->sx, h, profondita);
    *profondita--;
    potasottoalbero(&(*t)->dx, h, profondita);
}