Re: [SR-Users] How to avoid mem leak when use Kamailio Json module

2014-11-06 Thread Daniel-Constantin Mierla
OK, I pushed it to branches 4.2 and 4.1 Cheers, Daniel On 06/11/14 11:15, dongwf wrote: > Hi, I checked with my test env, your fix is ok, please port, thanks! > > > > > > At 2014-11-05 21:35:40, "Daniel-Constantin Mierla" > wrote: > > Hello, > > I pushed a fix that should release the jso

Re: [SR-Users] How to avoid mem leak when use Kamailio Json module

2014-11-06 Thread dongwf
Hi, I checked with my test env, your fix is ok, please port, thanks! At 2014-11-05 21:35:40, "Daniel-Constantin Mierla" wrote: Hello, I pushed a fix that should release the json object: - http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=def8d2600422a442b971c204df98594b0

Re: [SR-Users] How to avoid mem leak when use Kamailio Json module

2014-11-05 Thread Daniel-Constantin Mierla
Hello, I pushed a fix that should release the json object: - http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=def8d2600422a442b971c204df98594b0dfdaacd dst_pv->setf() should copy (clone) of the string value and then the object can be unreferenced. If works ok, then I will ba

Re: [SR-Users] How to avoid mem leak when use Kamailio Json module

2014-11-05 Thread dongwf
One more question based the last mail, if I want to return the j object pointer via PV to script( created as struct json_object *j = json_tokener_parse(json_s.s);), how can I achieve that? Then I can put the pointer back to another exported api and release the pointer via json_object_put, thank

[SR-Users] How to avoid mem leak when use Kamailio Json module

2014-11-05 Thread dongwf
Hi: I am trying to use json module in script with json_get_field exported api, I found in it's implementation, the api will call struct json_object *j = json_tokener_parse(json_s.s); but didn't call json_object_put for this j object, then the object will leak. So my question is how to release th