Skip to content

Commit

Permalink
conf: cleanup macros setup_sysctl_parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 19, 2019
1 parent fd214f3 commit e6f7645
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lxc/conf.c
Expand Up @@ -2632,10 +2632,10 @@ int setup_resource_limits(struct lxc_list *limits, pid_t pid)

int setup_sysctl_parameters(struct lxc_list *sysctls)
{
__do_free char *tmp = NULL;
struct lxc_list *it;
struct lxc_sysctl *elem;
int ret = 0;
char *tmp = NULL;
char filename[PATH_MAX] = {0};

lxc_list_for_each (it, sysctls) {
Expand All @@ -2647,7 +2647,6 @@ int setup_sysctl_parameters(struct lxc_list *sysctls)
}

ret = snprintf(filename, sizeof(filename), "/proc/sys/%s", tmp);
free(tmp);
if (ret < 0 || (size_t)ret >= sizeof(filename)) {
ERROR("Error setting up sysctl parameters path");
return -1;
Expand Down

0 comments on commit e6f7645

Please sign in to comment.