libmount: variable dereferenced before check [smatch scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2015-08-05 12:46:56 +02:00
parent ffab025db8
commit 941c734c56
1 changed files with 2 additions and 1 deletions

View File

@ -247,13 +247,14 @@ int mnt_optstr_append_option(char **optstr, const char *name, const char *value)
int mnt_optstr_prepend_option(char **optstr, const char *name, const char *value)
{
int rc = 0;
char *tmp = *optstr;
char *tmp;
if (!optstr)
return -EINVAL;
if (!name || !*name)
return 0;
*tmp = *optstr;
*optstr = NULL;
rc = mnt_optstr_append_option(optstr, name, value);