efl_core_command_line: Fix dereference before NULL check

This patch fixes an issue detected by Coverity where
pd->string_command is dereferenced before a NULL check.

Fixes Coverity CID1399098

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8311
This commit is contained in:
Christopher Michael 2019-03-12 10:07:26 -04:00 committed by Marcel Hollerbach
parent 2cef513694
commit 3cdb7df50b
1 changed files with 3 additions and 1 deletions

View File

@ -257,7 +257,9 @@ _efl_core_command_line_command_string_set(Eo *obj EINA_UNUSED, Efl_Core_Command_
EINA_SAFETY_ON_TRUE_RETURN_VAL(pd->filled, EINA_FALSE);
pd->string_command = eina_strdup(str);
_remove_invalid_chars(pd->string_command);
if (pd->string_command)
_remove_invalid_chars(pd->string_command);
pd->command = _unescape(str);
if (!pd->command)
{