]> git.puffer.fish Git - mirror/frr.git/commitdiff
2004-10-31 Paul Jakma <paul@dishone.st>
authorpaul <paul>
Sun, 31 Oct 2004 16:43:17 +0000 (16:43 +0000)
committerpaul <paul>
Sun, 31 Oct 2004 16:43:17 +0000 (16:43 +0000)
* thread.c: Use XCALLOC and sizeof the type, not the pointer.

lib/ChangeLog
lib/thread.c

index 57fd64fdde6243f6317a2a70a3bdde0f4f6e4e37..6604ec856bba0c143300afcbea63f89ae14bdfb7 100644 (file)
@@ -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>
index 94fdf1f52f2d8916819323871d1054b14ff4b0ce..09d6ff733292f60d68295eb5570a6f85a6f017be 100644 (file)
@@ -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;