summaryrefslogtreecommitdiff
path: root/frontends/monkey/dispatch.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-09-07 15:24:37 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-09-07 15:24:37 +0100
commit8b0aec4bac4af7fe119227280ed15bf014f104c3 (patch)
treea726d583b4d77fe3688271e2a69d449eb3965d7b /frontends/monkey/dispatch.c
parentb03786920aa4aff2194d2e9c94e8301546897ae9 (diff)
downloadnetsurf-8b0aec4bac4af7fe119227280ed15bf014f104c3.tar.gz
netsurf-8b0aec4bac4af7fe119227280ed15bf014f104c3.tar.bz2
Monkey: Clean up various leaked blocks
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'frontends/monkey/dispatch.c')
-rw-r--r--frontends/monkey/dispatch.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/frontends/monkey/dispatch.c b/frontends/monkey/dispatch.c
index e60325cf1..08bd352d5 100644
--- a/frontends/monkey/dispatch.c
+++ b/frontends/monkey/dispatch.c
@@ -29,7 +29,7 @@
typedef struct cmdhandler {
struct cmdhandler *r_next, *r_prev;
- const char *cmd;
+ char *cmd;
handle_command_fn fn;
} monkey_cmdhandler_t;
@@ -50,6 +50,17 @@ monkey_register_handler(const char *cmd, handle_command_fn fn)
}
void
+monkey_free_handlers(void)
+{
+ while (handler_ring != NULL) {
+ monkey_cmdhandler_t *handler = handler_ring;
+ RING_REMOVE(handler_ring, handler);
+ free(handler->cmd);
+ free(handler);
+ }
+}
+
+void
monkey_process_command(void)
{
char buffer[PATH_MAX];