[sr-dev] git:3.3: drouting: reset the content of routing tree if root pointer is not freed

Daniel-Constantin Mierla miconda at gmail.com
Thu Jun 14 12:56:45 CEST 2012


Module: sip-router
Branch: 3.3
Commit: a1983f7f059262ba47b9c2fcf6f31feefac624c1
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a1983f7f059262ba47b9c2fcf6f31feefac624c1

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Jun 13 11:51:57 2012 +0200

drouting: reset the content of routing tree if root pointer is not freed

- reported by Yufei Tao
(cherry picked from commit c737ff95bb2e742981d81088169baa60d4605b85)

---

 modules_k/drouting/routing.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules_k/drouting/routing.c b/modules_k/drouting/routing.c
index 1ff7629..f54709e 100644
--- a/modules_k/drouting/routing.c
+++ b/modules_k/drouting/routing.c
@@ -460,7 +460,8 @@ free_rt_data(
 			shm_free(rt_data->noprefix.rg);
 			rt_data->noprefix.rg = 0;
 		}
-		/* del top level */
+		/* del top level or reset to 0 it's content */
 		if (all) shm_free(rt_data);
+		else memset(rt_data, 0, sizeof(rt_data_t));
 	}
 }




More information about the sr-dev mailing list