summaryrefslogtreecommitdiff
path: root/gcc/ada/a-direct.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-29 16:22:32 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-29 16:22:32 +0000
commit04630209a53b983d35daafe2979239b037b8f245 (patch)
tree5fe482ead953da9596e3d6a901df2bdaac034483 /gcc/ada/a-direct.adb
parent566caa91e23553c7e9f47977a357a14ea755589d (diff)
downloadgcc-04630209a53b983d35daafe2979239b037b8f245.tar.gz
2005-03-29 Robert Dewar <dewar@adacore.com>
* a-direct.ads, a-direct.adb (Start_Search): Free allocated search buffer if an exception is raised. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97188 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-direct.adb')
-rw-r--r--gcc/ada/a-direct.adb17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/ada/a-direct.adb b/gcc/ada/a-direct.adb
index 33562f11fb8..810455941eb 100644
--- a/gcc/ada/a-direct.adb
+++ b/gcc/ada/a-direct.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004 Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -31,15 +31,15 @@
-- --
------------------------------------------------------------------------------
-with Ada.Directories.Validity; use Ada.Directories.Validity;
-with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
+with Ada.Directories.Validity; use Ada.Directories.Validity;
+with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Unchecked_Deallocation;
-with Ada.Characters.Handling; use Ada.Characters.Handling;
+with Ada.Characters.Handling; use Ada.Characters.Handling;
-with GNAT.Directory_Operations; use GNAT.Directory_Operations;
-with GNAT.OS_Lib; use GNAT.OS_Lib;
-with GNAT.Regexp; use GNAT.Regexp;
--- ??? Ada units cannot depend on GNAT units
+with GNAT.Directory_Operations; use GNAT.Directory_Operations;
+with GNAT.OS_Lib; use GNAT.OS_Lib;
+with GNAT.Regexp; use GNAT.Regexp;
+-- ??? Ada units should not depend on GNAT units
with System;
@@ -938,6 +938,7 @@ package body Ada.Directories is
exception
when Error_In_Regexp =>
+ Free (Search.Value);
raise Name_Error;
end;