diff options
author | paul <paul> | 2004-10-31 16:43:17 +0000 |
---|---|---|
committer | paul <paul> | 2004-10-31 16:43:17 +0000 |
commit | 039b95776979c74f7d02719800f9d742338e815b (patch) | |
tree | f833c1f87818c79b17cec0c3c87b2e4763675c90 | |
parent | 70e149e0492c369a64933d63c212d4e15cd5194e (diff) |
2004-10-31 Paul Jakma <paul@dishone.st>
* thread.c: Use XCALLOC and sizeof the type, not the pointer.
-rw-r--r-- | lib/ChangeLog | 3 | ||||
-rw-r--r-- | lib/thread.c | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 57fd64fd..6604ec85 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -6,7 +6,8 @@ * keychain.c: Convert some more strtoul users to VTY_GET_INTEGER. * memory.h: Add MTYPE_THREAD_FUNCNAME and MTYPE_THREAD_STATS * thread.c: Update stats and funcname alloc/free to use previous - specific memory type defines + specific memory type defines. Use XCALLOC and sizeof the type, + not the pointer. * smux.c: fix int to size_t compile warnings 2004-10-29 Paul Jakma <paul@dishone.st> diff --git a/lib/thread.c b/lib/thread.c index 94fdf1f5..09d6ff73 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -104,8 +104,7 @@ static void* cpu_record_hash_alloc (struct cpu_thread_history *a) { struct cpu_thread_history *new; - new = XMALLOC( MTYPE_THREAD_STATS, sizeof *new); - memset(new, 0, sizeof (struct cpu_thread_history)); + new = XCALLOC (MTYPE_THREAD_STATS, sizeof (struct cpu_thread_history)); new->func = a->func; new->funcname = XSTRDUP(MTYPE_THREAD_FUNCNAME, a->funcname); return new; |