diff options
author | Nick Clifton <nickc@redhat.com> | 2003-03-31 18:13:25 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-03-31 18:13:25 +0000 |
commit | 5ed6aba41c826194dcc97807392b22a3cefa1d7e (patch) | |
tree | 8e87d13436f477ba70e90e9109c69dcaf3d18e27 /ld/lexsup.c | |
parent | ee42cf8cc569b0ad926df63483075ccd868a10fa (diff) | |
download | binutils-5ed6aba41c826194dcc97807392b22a3cefa1d7e.tar.gz binutils-5ed6aba41c826194dcc97807392b22a3cefa1d7e.tar.bz2 binutils-5ed6aba41c826194dcc97807392b22a3cefa1d7e.zip |
Fix memory leaks
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r-- | ld/lexsup.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c index b6c2fd87ace..e8c2eba7b93 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -1116,6 +1116,8 @@ parse_args (argc, argv) case 'Y': if (strncmp (optarg, "P,", 2) == 0) optarg += 2; + if (default_dirlist != NULL) + free (default_dirlist); default_dirlist = xstrdup (optarg); break; case 'y': @@ -1193,8 +1195,10 @@ parse_args (argc, argv) lang_leave_group (); if (default_dirlist != NULL) - set_default_dirlist (default_dirlist); - + { + set_default_dirlist (default_dirlist); + free (default_dirlist); + } } /* Add the (colon-separated) elements of DIRLIST_PTR to the |