In the United States Presidential Primaries, what happens to a candidates delegates if they later withdraw from the race? For example, in the 2016 Republican Presidential Primary for the State of New Hampshire, Donald Trump would win 11 Delegates, John Kasich would win 3, Ted Cruz would win 2, Jeb Bush would win 2 and Marco Rubio would win 2. What happens to these delegates if/when one of these candidates withdraws from the Presidential race? Are they awarded to the withdrawn candidate anyway? Divided up between the remaining candidates in some proportion?
UPD 3/2/20: On March 1, Pete Buttigieg dropped out despite being the third candidate by delegates. What will happen to those nearly 30 delegates that he had won by that point? Are they free to cast their votes as they please or can Pete "direct" them to back Biden in order to help him thwart Bernie (a drop in the bucket but still)?