Fix: use max between index and nbmem for syscall table realloc
authorDavid Goulet <dgoulet@efficios.com>
Tue, 30 Sep 2014 16:00:31 +0000 (12:00 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 30 Sep 2014 16:00:31 +0000 (12:00 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/syscall.c

index 95d30d07459dc98d12dfb2ca680f1773cdac7c52..ee7578051e2a12d3322cb6e3d9fd4ae2946da1a7 100644 (file)
@@ -81,7 +81,7 @@ int syscall_init_table(void)
                        size_t new_nbmem;
 
                        /* Double memory size. */
-                       new_nbmem = index << 1;
+                       new_nbmem = max(index, nbmem << 1);
 
                        DBG("Reallocating syscall table from %zu to %zu entries", nbmem,
                                        new_nbmem);
This page took 0.03356 seconds and 4 git commands to generate.