From 08a36d0949811b9d3f5de93ac5cf397db662142a Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Sun, 25 May 2008 15:10:04 +0000 Subject: [PATCH] Tue May 20 13:28:44 EDT 2008 Pekka.Pessi@nokia.com * su_alloc.c: fixed klocworks issues git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8621 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index d76cec799f..66e6622bf9 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Sun May 25 11:08:26 EDT 2008 +Sun May 25 11:09:54 EDT 2008 diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c b/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c index a1bf6f206b..b2e5e8e03c 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c @@ -1088,7 +1088,7 @@ int su_home_move(su_home_t *dst, su_home_t *src) else used = s->sub_used; - if ((used && d == NULL) || 3 * used > 2 * d->sub_n) { + if (used && (d == NULL || 3 * used > 2 * d->sub_n)) { if (d) for (n = n2 = d->sub_n; 3 * used > 2 * n2; n2 = 4 * n2 + 3) ; @@ -1122,7 +1122,9 @@ int su_home_move(su_home_t *dst, su_home_t *src) d = d2; } - if ((n = s->sub_n)) { + if (s->sub_used) { + n = s->sub_n; + for (i = 0; i < n; i++) if (s->sub_nodes[i].sua_data) { su_block_add(d, s->sub_nodes[i].sua_data)[0] = s->sub_nodes[i]; @@ -1134,6 +1136,7 @@ int su_home_move(su_home_t *dst, su_home_t *src) } if (s->sub_stats) { + /* XXX */ } } @@ -1649,7 +1652,7 @@ void su_home_init_stats(su_home_t *home) /** Retrieve statistics from memory home. */ void su_home_get_stats(su_home_t *home, int include_clones, - su_home_stat_t hs[1], + su_home_stat_t *hs, isize_t size) { su_block_t *sub; @@ -1657,7 +1660,7 @@ void su_home_get_stats(su_home_t *home, int include_clones, if (hs == NULL || size < (sizeof hs->hs_size)) return; - memset(hs, 0, size); + memset((void *)hs, 0, size); sub = MEMLOCK(home);