]> granicus.if.org Git - strace/commitdiff
unwind: use xgrowarray
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 14 Dec 2017 00:05:04 +0000 (00:05 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 14 Dec 2017 00:05:04 +0000 (00:05 +0000)
* unwind.c (get_symbol_name): Use xgrowarray instead of manual
dynamic array management using xreallocarray.

unwind.c

index 18f06254654cf41f62f1863796da31949ddd1e9b..d37f016957126913f4add0347cd75ca8a7785678 100644 (file)
--- a/unwind.c
+++ b/unwind.c
@@ -279,8 +279,7 @@ get_symbol_name(unw_cursor_t *cursor, char **name,
                        *offset = 0;
                        break;
                }
-               *name = xreallocarray(*name, 2, *size);
-               *size *= 2;
+               *name = xgrowarray(*name, size, 1);
        }
 }