From eccabeb81c67953ca15f8d318fccc0f7f4370020 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 5 Aug 2016 12:23:15 +0200 Subject: options: fix channels options copy/free operations For some fucked up reason the arguments can be NULL. Makes no sense to me, but ok. --- options/m_option.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'options') diff --git a/options/m_option.c b/options/m_option.c index 231b9aa5d2..fd1e6770ee 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2365,6 +2365,9 @@ static char *print_channels(const m_option_t *opt, const void *val) static void free_channels(void *src) { + if (!src) + return; + struct m_channels *ch = src; talloc_free(ch->chmaps); *ch = (struct m_channels){0}; @@ -2372,6 +2375,9 @@ static void free_channels(void *src) static void copy_channels(const m_option_t *opt, void *dst, const void *src) { + if (!(dst && src)) + return; + struct m_channels *ch = dst; free_channels(dst); *ch = *(struct m_channels *)src; -- cgit v1.2.3