]> 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>
Tue, 15 Aug 2017 20:50:48 +0000 (16:50 -0400)
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
src/lxc/tools/lxc_start.c

index ef45ffb083d435f57984ce212e5339cce308c9f4..20d5b0364320f56925a579ce2c6ffeee0620a1d9 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 = EXIT_SUCCESS;
 
 err:
-       free(fullpath);
        return err;
 }