Repository navigation
Conversation
There was a problem hiding this comment.
intern->file_name could be left with a dangling pointer if a later parameter fails to parse. This isn't currently an issue because new will destroy the object, and ReflectionClass::newInstanceWithoutConstructor() doesn't actually allow calling __construct (prevented by spl_filesystem_object_get_method_check()). Nonetheless, it might be preferable to store it to a variable and copy it to intern when parsing is successful.
&intern->u.file.zcontext doesn't really apply, since it's the last parameter, but for consistency it might still make sense.
There was a problem hiding this comment.
I've rewritten it so that it takes dedicated stack variables. However, the fact that intern->file_name is not working on a copy seems quite dubious.
ndossche
left a comment
There was a problem hiding this comment.
Ok for me apart from the TODO that Ilija explained and my remark
…failed SplFileObject::__constructor)
15e23da to
f639125
Compare
Also fix a memory leak when reinitializing SplFileTemp