summaryrefslogtreecommitdiffstats
path: root/libmount/src/optstr.c
diff options
context:
space:
mode:
authorKarel Zak2015-08-05 12:46:56 +0200
committerKarel Zak2015-08-05 12:46:56 +0200
commit941c734c569fe2aac20e45c75fdc63165e69413d (patch)
tree83613d54dd88ceb9db44f066ef6afd4743e5ad5d /libmount/src/optstr.c
parentcfdisk, sfdisk: remove unused variables (diff)
downloadkernel-qcow2-util-linux-941c734c569fe2aac20e45c75fdc63165e69413d.tar.gz
kernel-qcow2-util-linux-941c734c569fe2aac20e45c75fdc63165e69413d.tar.xz
kernel-qcow2-util-linux-941c734c569fe2aac20e45c75fdc63165e69413d.zip
libmount: variable dereferenced before check [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/optstr.c')
-rw-r--r--libmount/src/optstr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index a729695f1..6593c1abe 100644
--- a/libmount/src/optstr.c
+++ b/libmount/src/optstr.c
@@ -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);