elm_prefs_cc_parse.c: tok null check in advance.

This fixes coverity CID 1040003 Dereference before null check (REVERSE_INULL).
This commit is contained in:
Daniel Juyung Seo 2013-08-11 15:38:16 +09:00
parent d605252bc7
commit b5193a7ac3
1 changed files with 2 additions and 1 deletions

View File

@ -388,6 +388,7 @@ done:
*new_p = p;
tok = mem_alloc(tok_end - tok_start + 2);
if (!tok) return NULL;
strncpy(tok, tok_start, tok_end - tok_start + 1);
tok[tok_end - tok_start + 1] = 0;
@ -425,7 +426,7 @@ done:
}
}
}
else if ((tok) && (*tok == '('))
else if (*tok == '(')
{
char *tmp;
tmp = tok;