From ff029cb4cfae6e9984821d5f9c9dd49c2d566f96 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 19 Oct 2014 05:46:16 +0200 Subject: lua: strictly free memory on errors Thanks to the recently introduced mp_lua_PITA(), this is "simple" now. It fixes leaks on Lua errors. The hack to avoid stack overflows manually isn't needed anymore, and the Lua error handler will take care of this. --- options/m_option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'options') diff --git a/options/m_option.c b/options/m_option.c index a84d7e4d41..52a222e87e 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -35,6 +35,7 @@ #include #include "libmpv/client.h" +#include "player/client.h" #include "talloc.h" #include "common/common.h" @@ -3092,7 +3093,7 @@ static void copy_node(const m_option_t *opt, void *dst, const void *src) dup_node(NULL, &VAL(dst)); } -static void *node_get_alloc(struct mpv_node *node) +void *node_get_alloc(struct mpv_node *node) { // Assume it was allocated with copy_node(), which allocates all // sub-nodes with the parent node as talloc parent. -- cgit v1.2.3