]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: #1438392 2525/head
author2xsec <dh48.jeong@samsung.com>
Tue, 14 Aug 2018 04:29:50 +0000 (13:29 +0900)
committer2xsec <dh48.jeong@samsung.com>
Tue, 14 Aug 2018 04:29:50 +0000 (13:29 +0900)
Dereference before null check

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
src/lxc/pam/pam_cgfs.c

index 6d1d468d93ce4258558d802607cacc5638338cdf..2975b64567751e021de604fd9f6ab5251316e876 100644 (file)
@@ -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);