I have the following lines in a plugin dissector. The call to g_free below results in a "STATUS_ACCESS_VIOLATION: dissector accessed an invalid memory address." Looking at the memory address of pchar1 it looks valid and holds a a short string string. Looking deeper into get_CDR_octet_seq I can see that it allocates memory using ep_alloc_array0. However, the documentation of this function states "Caller of this function must remember to free the array pointed to by seq." It looks like the code changed from 1.8 to 1.10. Should I file a bug report on the need for the code comments to change?
asked 18 Oct ‘13, 16:38 tlann |
One Answer:
You are right the function was changed in revision 4498 for bug 3725 but the comment was not updated accordingly. I checked in updated comments in revision 52690 and in your code you just need to remove the g_free call (ephemeral memory will be automatically freed once the packet dissection is done). answered 19 Oct '13, 09:14 Pascal Quantin |
Thanks. I kinda figured out I needed to remove g_free. ;-)