]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix mem leak with realpath
authorShukui Yang <yangshukui@huawei.com>
Fri, 11 Aug 2017 09:12:24 +0000 (17:12 +0800)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 17 Aug 2017 19:37:42 +0000 (15:37 -0400)
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
src/lxc/lxc_start.c

index 45eac11cdf7d5f581cac74b635375ecfdbc3c396..5bd7f99c588d6c23df77def563ec2906a106e5e7 100644 (file)
@@ -80,16 +80,11 @@ static int ensure_path(char **confpath, const char *path)
                        goto err;
                }
 
-               *confpath = strdup(fullpath);
-               if (!*confpath) {
-                       ERROR("failed to dup string '%s'", fullpath);
-                       goto err;
-               }
+               *confpath = fullpath;
        }
        err = 0;
 
 err:
-       free(fullpath);
        return err;
 }