summaryrefslogtreecommitdiffstats
path: root/m_config.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-06 01:24:24 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-06 06:47:26 +0300
commit39e373aa8d2341e6ae81db1787981bc952a1b156 (patch)
treea47767170c2d842c34f2ad5cdce7f0789b191dd7 /m_config.c
parenta4166ac23933b4af9074ad801615127135bc98f3 (diff)
downloadmpv-39e373aa8d2341e6ae81db1787981bc952a1b156.tar.bz2
mpv-39e373aa8d2341e6ae81db1787981bc952a1b156.tar.xz
options: allocate dynamic options with talloc
Allocate data structures for dynamic option values with talloc. Hopefully there's no code left that tries to modify those dynamic option values outside the option parser and relies on them being malloc-allocated. Currently talloc functionality isn't used much and the allocations are not hierarchical, so the main practical use for now is just to allow very easy checking for memory leaks.
Diffstat (limited to 'm_config.c')
-rw-r--r--m_config.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/m_config.c b/m_config.c
index c6f031cdcb..fcf86e785f 100644
--- a/m_config.c
+++ b/m_config.c
@@ -463,10 +463,10 @@ static int m_config_parse_option(const struct m_config *config, char *arg,
r = sr;
}
}
- free(lst[2 * i]);
- free(lst[2 * i + 1]);
+ talloc_free(lst[2 * i]);
+ talloc_free(lst[2 * i + 1]);
}
- free(lst);
+ talloc_free(lst);
} else
r = m_option_parse(co->opt, arg, param, set ? co->slots->data : NULL,
config->mode);