* python/py-auto-load.c (source_section_scripts): Fix file
descriptor leak. * python/python.c (source_python_script_for_objfile): Tweak comments.
This commit is contained in:
parent
3c9057f381
commit
562f943bcc
3 changed files with 18 additions and 11 deletions
|
@ -296,9 +296,6 @@ source_section_scripts (struct objfile *objfile, const char *source_name,
|
|||
in_hash_table = maybe_add_script (pspace_info->loaded_scripts, file,
|
||||
opened ? full_path : NULL);
|
||||
|
||||
if (opened)
|
||||
free (full_path);
|
||||
|
||||
if (! opened)
|
||||
{
|
||||
/* We don't throw an error, the program is still debuggable. */
|
||||
|
@ -310,12 +307,15 @@ Use `info auto-load-scripts [REGEXP]' to list them."),
|
|||
GDBPY_AUTO_SECTION_NAME, objfile->name);
|
||||
pspace_info->script_not_found_warning_printed = TRUE;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If this file is not currently loaded, load it. */
|
||||
if (! in_hash_table)
|
||||
source_python_script_for_objfile (objfile, stream, file);
|
||||
else
|
||||
{
|
||||
/* If this file is not currently loaded, load it. */
|
||||
if (! in_hash_table)
|
||||
source_python_script_for_objfile (objfile, stream, file);
|
||||
fclose (stream);
|
||||
free (full_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue