From: 2xsec Date: Tue, 14 Aug 2018 04:29:50 +0000 (+0900) Subject: coverity: #1438392 X-Git-Tag: lxc-3.1.0~165^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6926e3b80ede8f19d02ad58fc160b5b4b6aff58e;p=thirdparty%2Flxc.git coverity: #1438392 Dereference before null check Signed-off-by: 2xsec --- diff --git a/src/lxc/pam/pam_cgfs.c b/src/lxc/pam/pam_cgfs.c index 6d1d468d9..2975b6456 100644 --- a/src/lxc/pam/pam_cgfs.c +++ b/src/lxc/pam/pam_cgfs.c @@ -1897,8 +1897,7 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized) copy_parent: *lastslash = oldv; - if (fpath) - free(fpath); + free(fpath); fpath = must_make_path(path, "cpuset.cpus", NULL); ret = write_to_file(fpath, cpulist, strlen(cpulist), false);