diff options
author | DJ Delorie <dj@delorie.com> | 2013-11-12 21:16:41 +0000 |
---|---|---|
committer | DJ Delorie <dj@delorie.com> | 2013-11-12 21:16:41 +0000 |
commit | a0a1bb07cb2c03b7d34f12e734c6f363ddb7c7b2 (patch) | |
tree | d5f409ad0545e0b51ab0d30dabb7edd486ea0766 /libiberty/cp-demangle.c | |
parent | c0103114e381a575e98fa5e169474dc3da2a877c (diff) | |
download | binutils-redhat-master.tar.gz |
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r-- | libiberty/cp-demangle.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 7be9804856..cbe4d8c9f6 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -3968,7 +3968,7 @@ d_copy_templates (struct d_print_info *dpi) for (src = dpi->templates; src != NULL; src = src->next) { struct d_print_template *dst = - malloc (sizeof (struct d_print_template)); + (struct d_print_template *) malloc (sizeof (struct d_print_template)); if (dst == NULL) { @@ -4381,14 +4381,16 @@ d_print_comp (struct d_print_info *dpi, int options, if (scope == NULL) { + size_t size; + /* This is the first time SUB has been traversed. We need to capture the current templates so they can be restored if SUB is reentered as a substitution. */ ++dpi->num_saved_scopes; - scopes = realloc (dpi->saved_scopes, - sizeof (struct d_saved_scope) - * dpi->num_saved_scopes); + size = sizeof (struct d_saved_scope) * dpi->num_saved_scopes; + scopes = (struct d_saved_scope *) realloc (dpi->saved_scopes, + size); if (scopes == NULL) { d_print_error (dpi); |