summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authormifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-12-18 21:20:28 +0000
committermifi <mifi@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-12-18 21:20:28 +0000
commit02f3765351c9e25185b745b84f1a2604fb2149c7 (patch)
tree81331db01e68baf67bc2cc271b1f1ed2a6962d76 /src/server
parented1e9d6abdece4fbf6251a11f0eca3c921221048 (diff)
downloadopenocd_libswd-02f3765351c9e25185b745b84f1a2604fb2149c7.tar.gz
openocd_libswd-02f3765351c9e25185b745b84f1a2604fb2149c7.tar.bz2
openocd_libswd-02f3765351c9e25185b745b84f1a2604fb2149c7.tar.xz
openocd_libswd-02f3765351c9e25185b745b84f1a2604fb2149c7.zip
- added patch for new flash functionality like:
flash verify_image and flash erase_address. - added patch for new parport_write_on_exit command. Even this patch will fix some memory leaks. (thanks too oyvind and Spen for these patches) git-svn-id: svn://svn.berlios.de/openocd/trunk@240 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/server')
-rw-r--r--src/server/gdb_server.c7
-rw-r--r--src/server/server.c3
-rw-r--r--src/server/telnet_server.c11
3 files changed, 20 insertions, 1 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 657338ea..cd7e327f 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -447,9 +447,14 @@ int gdb_connection_closed(connection_t *connection)
delete_debug_msg_receiver(connection->cmd_ctx, gdb_service->target);
if (connection->priv)
+ {
free(connection->priv);
+ connection->priv = NULL;
+ }
else
+ {
ERROR("BUG: connection->priv == NULL");
+ }
target_unregister_event_callback(gdb_target_callback_event_handler, connection);
@@ -1325,7 +1330,7 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p
char *error_str;
/* process the flashing buffer */
- if ((result = flash_write(gdb_service->target, gdb_connection->vflash_image, &written, &error_str, NULL, 0)) != ERROR_OK)
+ if ((result = flash_image_operation(gdb_service->target, gdb_connection->vflash_image, &written, &error_str, NULL, flash_image_op_write)) != ERROR_OK)
{
if (result == ERROR_FLASH_DST_OUT_OF_BANK)
gdb_put_packet(connection, "E.memtype", 9);
diff --git a/src/server/server.c b/src/server/server.c
index 98b1fb1d..82f9f448 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -230,6 +230,8 @@ int remove_services()
c = next;
}
+ services = NULL;
+
return ERROR_OK;
}
@@ -454,3 +456,4 @@ int handle_shutdown_command(struct command_context_s *cmd_ctx, char *cmd, char *
return ERROR_COMMAND_CLOSE_CONNECTION;
}
+
diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c
index eeb2cc82..5353369a 100644
--- a/src/server/telnet_server.c
+++ b/src/server/telnet_server.c
@@ -506,21 +506,32 @@ int telnet_connection_closed(connection_t *connection)
int i;
if (t_con->prompt)
+ {
free(t_con->prompt);
+ t_con->prompt = NULL;
+ }
for (i = 0; i < TELNET_LINE_HISTORY_SIZE; i++)
{
if (t_con->history[i])
+ {
free(t_con->history[i]);
+ t_con->history[i] = NULL;
+ }
}
/* if this connection registered a debug-message receiver delete it */
delete_debug_msg_receiver(connection->cmd_ctx, NULL);
if (connection->priv)
+ {
free(connection->priv);
+ connection->priv = NULL;
+ }
else
+ {
ERROR("BUG: connection->priv == NULL");
+ }
target_unregister_event_callback(telnet_target_callback_event_handler, connection->cmd_ctx);