In the main I call a function as:

Code:
void test()
{
   double* x = new double[10];
   //----fill the array and print out stuff
   delete[] x;
}
I know that I should always call delete when using new. But, in this scenario the x object would be destroyed automatically when the function gets out of scope. So, what if I do not call delete in the function? Does it hurt other than being a bad practice?