Bug 47161 - [cppcheck][PATCH] found a memory leak in gcc/gcc/go/gofrontend/expressions.cc
Summary: [cppcheck][PATCH] found a memory leak in gcc/gcc/go/gofrontend/expressions.cc
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-04 00:40 UTC by Martin Ettl
Modified: 2011-01-05 05:35 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
proposed patch to fix the issue (225 bytes, patch)
2011-01-04 00:40 UTC, Martin Ettl
Details | Diff
fixing more memleaks (398 bytes, patch)
2011-01-04 15:46 UTC, Martin Ettl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Ettl 2011-01-04 00:40:40 UTC
Created attachment 22891 [details]
proposed patch to fix the issue

during a check of gcc's sources with the static code analysis tool cppcheck
(http://sourceforge.net/projects/cppcheck/) the tool discoverd a memory leak
in file gcc/gcc/go/gofrontend/expressions.cc. Please refer the attached patch
that fixes the issue.

Best regards from the cppcheck team

Ettl Martin
Comment 1 Martin Ettl 2011-01-04 15:46:07 UTC
Created attachment 22898 [details]
fixing more memleaks

A second run of cppcheck reveald further possible memory leaks. See "patch go_memleaks.patch" that fixes all found issues.
Comment 2 ian@gcc.gnu.org 2011-01-05 05:33:37 UTC
Author: ian
Date: Wed Jan  5 05:33:32 2011
New Revision: 168504

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=168504
Log:
	PR go/47158
	PR go/47159
	PR go/47160
	PR go/47161
Fix space leaks.
Patch from Ettl Martin.

Modified:
    trunk/gcc/go/gofrontend/expressions.cc
    trunk/gcc/go/gofrontend/gogo-tree.cc
    trunk/gcc/go/gofrontend/import-archive.cc
    trunk/gcc/go/gofrontend/import.cc
Comment 3 Ian Lance Taylor 2011-01-05 05:35:37 UTC
Patch committed.  Thanks.