Skip to content

Commit

Permalink
Fix mem leak with realpath
Browse files Browse the repository at this point in the history
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
  • Loading branch information
Shukui Yang authored and stgraber committed Aug 15, 2017
1 parent e9cab6e commit d370b8e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/lxc/tools/lxc_start.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit d370b8e

Please sign in to comment.