In my old plugin code(1.6), the following lines of codes has been used inside proto_register_myPlugin Routine to initialize Array to Zero. I know that se_alloc is invalid now and wmem_alloc should be used. I have tried different ways. It just isn't working. Could someone please help me? Thanks
asked 13 Feb ‘17, 04:43 xaheen edited 13 Feb ‘17, 09:37 Guy Harris ♦♦ |
One Answer:
Give a try to:
But was this memory freed somewhere else in the code? answered 13 Feb '17, 07:12 Pascal Quantin @Pascal Quantin wow! it worked! thanks. No, I havent freed the Memory. how do I do it? (13 Feb '17, 07:23) xaheen If it is not required to free the memory in your plugin, why allocate it dynamically and not define the array once for all? (13 Feb '17, 07:43) Pascal Quantin |
Could you please clarify what is not working exactly? Are you triggering an assert because you are not using the right memory scope?
@Pascal Quantin I am upgrading the dissector for wireshark 2.2 I am supposed to use wmem, which I have used but it is not compiling and not even showing any error. What could be the wmem_alloc Version for the above code. Thanks for your Response