y is not a long pointer, but a pointer to a
long
; but perhaps you meant that.
The expression
new long[x]
allocates an array of x elements each of type
long
and returns a pointer to the first element. Hence the answer is: No, there is nothing wrong with storing that pointer in your y.
The memory leak will probably result from the fact that you forgot to free that space again. Somewhere in your program you should have a statement like
delete[] y;
to free that storage.