Hi guys,

Seeing the https://github.com/kamailio/kamailio/pull/1144 about fixing a memory leak in the tm module due to incorrectly using FL_SHM_CLONE when freing path_vec memory, isn't there a case that a similar patch should be applied to corex/corex_lib.c ?

Inside corex_append_branch(..) function:

/* if this is a cloned message, don't free the path vector as it was copied into shm memory and will be freed as contiguous block*/
        if (!(msg->msg_flags&FL_SHM_CLONE)) {
            if(msg->path_vec.s!=0)
                pkg_free(msg->path_vec.s);
            msg->path_vec.s = 0;
            msg->path_vec.len = 0;
        }

Maybe we should switch to:

        if(msg->path_vec.s!=0)
            pkg_free(msg->path_vec.s);
        msg->path_vec.s = 0;
        msg->path_vec.len = 0;

If you agree this is the case, I will  prepare a pull request.

Thank you,
Lucian

_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to