FAQ
Is there any reason I would have to free a pointer from the language_parser if I am just storing a reference to $1

I'm doing this:
CG(accessor_node) = &$1;

And in doing so it is causing a memory leak, only if I add:

efree($1.u.constant.value.str.val);

Does that memory leak go away.

-Clint

Search Discussions

  • Felipe Pena at Nov 18, 2011 at 4:30 pm

    2011/11/18 Clint M Priest <cpriest@zerocue.com>:
    Is there any reason I would have to free a pointer from the language_parser if I am just storing a reference to $1

    I'm doing this:
    CG(accessor_node) = &$1;
    This doesn't looks right, as &$1 points to the local variable in yyparse().
    And in doing so it is causing a memory leak, only if I add:

    efree($1.u.constant.value.str.val);
    It's normal when not using the alloc'ed string into the op_array.

    --
    Regards,
    Felipe Pena

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedNov 18, '11 at 2:28p
activeNov 18, '11 at 4:30p
posts2
users2
websitephp.net

2 users in discussion

Clint M Priest: 1 post Felipe Pena: 1 post

People

Translate

site design / logo © 2022 Grokbase