diff options
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 b6c2fd8..e8c2eba 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 |