Holding the barre properly is very important...it should never be considered a crutch to lean on. Your hand should rest gently on the barre - never lean on it or grip it tightly. Your thumb should rest on top of the barre with the fingers, instead of underneath on its own. (Placing the thumb underneath would encourage a tight grip.)
If your dance studio is equipped with two barres of different heights, always choose the one that is too low rather than too high. Holding a barre that is too high may encourage you to hunch up your shoulders. Hold the barre slightly in fron of the rest of your body, standing far enough away from the barre to maintain a slightly bent elbow.