A boy has just rescued his dog from a barbed wire fence.