From: Karel Zak Date: Wed, 5 Aug 2015 10:46:56 +0000 (+0200) Subject: libmount: variable dereferenced before check [smatch scan] X-Git-Tag: v2.27-rc2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=941c734c569fe2aac20e45c75fdc63165e69413d;p=thirdparty%2Futil-linux.git libmount: variable dereferenced before check [smatch scan] Signed-off-by: Karel Zak --- diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c index a729695f11..6593c1abe4 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);