summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-19 05:46:16 +0200
committerwm4 <wm4@nowhere>2014-10-19 05:51:37 +0200
commitff029cb4cfae6e9984821d5f9c9dd49c2d566f96 (patch)
treeb1221d0b82c5a3684c8386eff56e50da43c9c495 /options
parent5548c75e5507da6a0f9fb6a45a07a5cc6edd9393 (diff)
downloadmpv-ff029cb4cfae6e9984821d5f9c9dd49c2d566f96.tar.bz2
mpv-ff029cb4cfae6e9984821d5f9c9dd49c2d566f96.tar.xz
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.
Diffstat (limited to 'options')
-rw-r--r--options/m_option.c3
1 files changed, 2 insertions, 1 deletions
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 <libavutil/avstring.h>
#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.