Skip to content
Snippets Groups Projects
Commit c5df3ce1 authored by oharboe's avatar oharboe
Browse files

Fixed bogus error message and plugged memory leak for the case when there was no reset script.

git-svn-id: svn://svn.berlios.de/openocd/trunk@728 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent c152c6a5
No related branches found
No related tags found
No related merge requests found
...@@ -217,6 +217,8 @@ target_t* get_current_target(command_context_t *cmd_ctx) ...@@ -217,6 +217,8 @@ target_t* get_current_target(command_context_t *cmd_ctx)
static void execute_script(struct command_context_s *cmd_ctx, char *reset_script) static void execute_script(struct command_context_s *cmd_ctx, char *reset_script)
{ {
if (reset_script==NULL)
return;
FILE *script; FILE *script;
script = open_file_from_path(reset_script, "r"); script = open_file_from_path(reset_script, "r");
if (!script) if (!script)
...@@ -237,7 +239,7 @@ int target_init_handler(struct target_s *target, enum target_event event, void * ...@@ -237,7 +239,7 @@ int target_init_handler(struct target_s *target, enum target_event event, void *
{ {
struct command_context_s *cmd_ctx = priv; struct command_context_s *cmd_ctx = priv;
if ((event == TARGET_EVENT_HALTED) && (target->reset_script)) if (event == TARGET_EVENT_HALTED)
{ {
target_unregister_event_callback(target_init_handler, priv); target_unregister_event_callback(target_init_handler, priv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment