From f6c91f4ac968758e02e2eaa95fd06aa5dee84377 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 26 Jul 2018 16:38:26 +0200 Subject: [PATCH] file: fix assertion raised in file_destroy() when node was never started (closes #186) --- lib/nodes/file.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/nodes/file.c b/lib/nodes/file.c index 709397e60..96bf81fcf 100644 --- a/lib/nodes/file.c +++ b/lib/nodes/file.c @@ -263,20 +263,12 @@ int file_stop(struct node *n) if (ret) return ret; - free(f->uri); - - return 0; -} - -int file_destroy(struct node *n) -{ - int ret; - struct file *f = (struct file *) n->_vd; - ret = io_destroy(&f->io); if (ret) return ret; + free(f->uri); + return 0; } @@ -383,7 +375,6 @@ static struct plugin p = { .print = file_print, .start = file_start, .stop = file_stop, - .destroy = file_destroy, .read = file_read, .write = file_write, .fd = file_fd