Does this I/O operation caused a memory leak
Absolutely, the 2nd example is the way to ensure disposable objects/resources are released for the GC. The using clause does this by enforcing the rule that the object being created must inherit from IDisposable. At the closing '}' of each using block, the object is disposed.  

In the first example, you will have memory leaks occur if you don't close and dispose the MemoryStream.