PR go/47158
PR go/47159
PR go/47160
PR go/47161
Fix space leaks.
Patch from Ettl Martin.
From-SVN: r168504
arg_val,
location);
if (args[i] == error_mark_node)
arg_val,
location);
if (args[i] == error_mark_node)
- return error_mark_node;
+ {
+ delete[] args;
+ return error_mark_node;
+ }
}
gcc_assert(pp == params->end());
gcc_assert(i == nargs);
}
gcc_assert(pp == params->end());
gcc_assert(i == nargs);
tree rettype = TREE_TYPE(TREE_TYPE(fntype->get_tree(gogo)));
if (rettype == error_mark_node)
tree rettype = TREE_TYPE(TREE_TYPE(fntype->get_tree(gogo)));
if (rettype == error_mark_node)
- return error_mark_node;
+ {
+ delete[] args;
+ return error_mark_node;
+ }
tree fn;
if (has_closure)
tree fn;
if (has_closure)
gcc_unreachable();
if (fn == error_mark_node || TREE_TYPE(fn) == error_mark_node)
gcc_unreachable();
if (fn == error_mark_node || TREE_TYPE(fn) == error_mark_node)
- return error_mark_node;
+ {
+ delete[] args;
+ return error_mark_node;
+ }
// This is to support builtin math functions when using 80387 math.
tree fndecl = fn;
// This is to support builtin math functions when using 80387 math.
tree fndecl = fn;
types[i] = va_arg(ap, tree);
args[i] = va_arg(ap, tree);
if (types[i] == error_mark_node || args[i] == error_mark_node)
types[i] = va_arg(ap, tree);
args[i] = va_arg(ap, tree);
if (types[i] == error_mark_node || args[i] == error_mark_node)
- return error_mark_node;
+ {
+ delete[] types;
+ delete[] args;
+ return error_mark_node;
+ }
- char* buf = new char[size];
- if (::read(this->fd_, buf, size) != size)
+ char* rdbuf = new char[size];
+ if (::read(this->fd_, rdbuf, size) != size)
{
error_at(this->location_, "%s: could not read extended names",
filename.c_str());
{
error_at(this->location_, "%s: could not read extended names",
filename.c_str());
- this->extended_names_.assign(buf, size);
- delete buf;
+ this->extended_names_.assign(rdbuf, size);
+ delete[] rdbuf;
if (c < 0)
{
error_at(location, "read %s failed: %m", filename.c_str());
if (c < 0)
{
error_at(location, "read %s failed: %m", filename.c_str());
return NULL;
}
if (c < sec_length)
{
error_at(location, "%s: short read", filename.c_str());
return NULL;
}
if (c < sec_length)
{
error_at(location, "%s: short read", filename.c_str());