summaryrefslogtreecommitdiff
path: root/src/named-ref.c
diff options
context:
space:
mode:
authorAlex Rozenman <rozenman@gmail.com>2009-07-24 21:04:16 +0300
committerAlex Rozenman <rozenman@gmail.com>2009-07-24 21:08:46 +0300
commit1e20ad112fc43f3d6adb3cc26be69ebffb14e9f6 (patch)
tree1ac6059b6c645e57c969840788aca549807976ef /src/named-ref.c
parentac9b0e954b1d3aed514a3bbd363da1514202af0f (diff)
downloadbison-1e20ad112fc43f3d6adb3cc26be69ebffb14e9f6.tar.gz
Fix some memory leaks.
* src/named-ref.c: Add a pointer check (named_ref_free). * src/scan-code.l: New function (variant_table_free). Called in code_scanner_free. * src/symlist.c: Call to named_ref_free (symbol_list_free).
Diffstat (limited to 'src/named-ref.c')
-rw-r--r--src/named-ref.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/named-ref.c b/src/named-ref.c
index 4388acba..41d9dc17 100644
--- a/src/named-ref.c
+++ b/src/named-ref.c
@@ -36,6 +36,7 @@ named_ref_new (uniqstr id, location loc)
void
named_ref_free (named_ref *r)
{
- free (r);
+ if (r)
+ free (r);
}