From: Joel Brobecker Date: Mon, 21 Mar 2011 14:43:14 +0000 (+0000) Subject: use xzalloc in ada-lang.c:replace_operator_with_call X-Git-Tag: gdb_7_3-branchpoint~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c1a34e7f56df3c2a3de9946bd185a897c18c20d;p=thirdparty%2Fbinutils-gdb.git use xzalloc in ada-lang.c:replace_operator_with_call This is to make sure that we cannot have a field with an undefined value (currently, we are not setting the gdbarch). gdb/ChangeLog: * ada-lang.c (replace_operator_with_call): Use xzalloc instead of xmalloc. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 64d8391ca6c..d79197e59d1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-03-21 Joel Brobecker + + * ada-lang.c (replace_operator_with_call): Use xzalloc instead + of xmalloc. + 2012-03-18 Pedro Alves * frame.c (frame_unwind_register): Throw an error if unwinding the diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index ed51ab05607..392ffea7212 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -3655,7 +3655,7 @@ replace_operator_with_call (struct expression **expp, int pc, int nargs, /* A new expression, with 6 more elements (3 for funcall, 4 for function symbol, -oplen for operator being replaced). */ struct expression *newexp = (struct expression *) - xmalloc (sizeof (struct expression) + xzalloc (sizeof (struct expression) + EXP_ELEM_TO_BYTES ((*expp)->nelts + 7 - oplen)); struct expression *exp = *expp;