Module: sip-router Branch: 3.2 Commit: 7f2e9173caf0da18bbd2fbad76f855c6bf5703bf URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7f2e9173...
Author: Iñaki Baz Castillo ibc@aliax.net Committer: Iñaki Baz Castillo ibc@aliax.net Date: Tue Feb 28 20:26:18 2012 +0100
[regex_mod] Fix a double freeing in free_shared_memory() function.
---
modules_k/regex/regex_mod.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/modules_k/regex/regex_mod.c b/modules_k/regex/regex_mod.c index bb0241b..d5b2ab0 100644 --- a/modules_k/regex/regex_mod.c +++ b/modules_k/regex/regex_mod.c @@ -177,8 +177,6 @@ struct module_exports exports = { */ static int mod_init(void) { - LM_INFO("initializing module...\n"); - if(register_mi_mod(exports.name, mi_cmds)!=0) { LM_ERR("failed to register MI commands\n"); @@ -233,9 +231,9 @@ static int mod_init(void) } /* Load the pcres */ - LM_NOTICE("loading pcres...\n"); + LM_DBG("loading pcres...\n"); if (load_pcres(START)) { - LM_CRIT("failed to load pcres\n"); + LM_ERR("failed to load pcres\n"); goto err; } } @@ -384,9 +382,9 @@ static int load_pcres(int action) } /* Log the group patterns */ - LM_NOTICE("num groups = %d\n", num_pcres_tmp); + LM_INFO("num groups = %d\n", num_pcres_tmp); for (i=0; i < num_pcres_tmp; i++) { - LM_NOTICE("<group[%d]>%s</group[%d]> (size = %i)\n", i, patterns[i], i, (int)strlen(patterns[i])); + LM_INFO("<group[%d]>%s</group[%d]> (size = %i)\n", i, patterns[i], i, (int)strlen(patterns[i])); } /* Temporal pointer of pcres */ @@ -498,19 +496,23 @@ static void free_shared_memory(void) } } shm_free(pcres); + pcres = NULL; } if (num_pcres) { shm_free(num_pcres); + num_pcres = NULL; } if (pcres_addr) { shm_free(pcres_addr); + pcres_addr = NULL; } if (reload_lock) { lock_destroy(reload_lock); lock_dealloc(reload_lock); + reload_lock = NULL; } }
@@ -672,11 +674,11 @@ static struct mi_root* mi_pcres_reload(struct mi_root* cmd, void* param) return init_mi_tree(403, MI_SSTR("Group matching not enabled")); } - LM_NOTICE("reloading pcres...\n"); + LM_INFO("reloading pcres...\n"); if (load_pcres(RELOAD)) { LM_ERR("failed to reload pcres\n"); return init_mi_tree(500, MI_INTERNAL_ERR_S, MI_INTERNAL_ERR_LEN); } - LM_NOTICE("reload success\n"); + LM_INFO("reload success\n"); return init_mi_tree(200, MI_OK_S, MI_OK_LEN); }
2012/2/29 Inaki Baz Castillo ibc@aliax.net:
Module: sip-router Branch: 3.2 Commit: 7f2e9173caf0da18bbd2fbad76f855c6bf5703bf URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7f2e9173...
Author: Iñaki Baz Castillo ibc@aliax.net Committer: Iñaki Baz Castillo ibc@aliax.net Date: Tue Feb 28 20:26:18 2012 +0100
[regex_mod] Fix a double freeing in free_shared_memory() function.
Hi, how to make a cherry-pick visible in the remote repository? I did the following:
$ git checkout -b 3.2 origin/3.2 Branch 3.2 set up to track remote branch 3.2 from origin by rebasing. Switched to a new branch '3.2'
$ git cherry-pick 2e96a72c3b16ccf7a1854eb83be3c779474bee3b [3.2 7f2e917] [regex_mod] Fix a double freeing in free_shared_memory() function. 1 files changed, 10 insertions(+), 8 deletions(-)
$ git push Counting objects: 9, done. Delta compression using up to 2 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 585 bytes, done. Total 5 (delta 4), reused 0 (delta 0) remote: Mailing notify to sr-dev@lists.sip-router.org remote: commit_notice 3.2, 7f2e9173caf0da18bbd2fbad76f855c6bf5703bf To ssh://ibc@git.sip-router.org/sip-router 3259ef7..7f2e917 3.2 -> 3.2
I expected that the commit to 3.2 branch would refer the original master commit "2e96a72c3b16ccf7a1854eb83be3c779474bee3b" in some way, but it has become a new commit "7f2e9173caf0da18bbd2fbad76f855c6bf5703bf".
Just wondering.
Thanks a lot.