diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-10-31 12:59:17 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-10-31 12:59:17 +0000 |
commit | aa589da439e8e5f9e3636eb52763d3e0cf54eb60 (patch) | |
tree | 5595f7dcd6921a3a3938b4b89edf2695d4772c59 | |
parent | d4020af479760130d81c1d608d27de96c43c7bd6 (diff) |
Avoid a potential memleak in parse_obj_params in case of a missing
m_ob_params_t part. Fixes bug #1318.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27869 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | m_option.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/m_option.c b/m_option.c index e2a644402b..1991bb4a56 100644 --- a/m_option.c +++ b/m_option.c @@ -1476,13 +1476,14 @@ static int parse_obj_params(const m_option_t* opt,const char *name, int r; m_obj_params_t* p = opt->priv; const m_struct_t* desc; - char* cpy = strdup(param); + char* cpy; // We need the object desc if(!p) return M_OPT_INVALID; desc = p->desc; + cpy = strdup(param); r = get_obj_params(name,desc->name,cpy,desc,p->separator,dst ? &opts : NULL); free(cpy); if(r < 0) |