Fixing with local variable Would like to do void some_function(int size) { char fred[size]; // do some stuff } If an exception is thrown, fred is automatically deleted when the function ends But can't do this, since size isn't known until runtime