Not if you only populate a pointer to the key and not copy it. That is, copy the fields you need and a pointer to the key. Use a new kind of struct if necessary. You would just have to be careful never to use that key pointer after deleting the original, but from the code I don't see that as a problem.