Skip to content

Commit

Permalink
bug in dereferencing for NetworkIO Provider when multiple containers …
Browse files Browse the repository at this point in the history
…are passed
  • Loading branch information
ArneTR committed Oct 2, 2023
1 parent 6df80f1 commit 2005c59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metric_providers/network/io/cgroup/container/source.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,15 @@ static int parse_containers(container_t** containers, char* containers_string, i
fprintf(stderr, "Error - cgroup.procs file %s failed to open: errno: %d\n", (*containers)[length-1].path, errno);
exit(1);
}
fscanf(fd, "%u", &(containers[length-1]->pid));
fscanf(fd, "%u", &(*containers)[length-1].pid);
fclose(fd);
}

if(length == 0) {
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
exit(1);
}

return length;
}

Expand Down

0 comments on commit 2005c59

Please sign in to comment.