Can this PHP node leak memory?
It doesn't look like this is causing a memory leak as @tenken said in his comment.  However, since this is going in a node, that whole PHP snippet is stored in the database which isn't recommended.  It will take more memory to grab this code from the database, then run it.

Try sticking the code in a function in PHP file and then running that function somewhere else on the site, i.e. a custom module.  This is a good tutorial on how to do that.