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
This commit is contained in:
reimar 2008-10-31 12:59:17 +00:00
parent d4020af479
commit aa589da439
1 changed files with 2 additions and 1 deletions

View File

@ -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)