Just make sure that you add decent bracing, unless you fix the uprights firmly to the wall. Think about the weight of equipment likely to be on the bench - a sideways push may create enough momentum to collapse the legs and the higher the bench the less force required.