Skip to content

Commit d17fd87

Browse files
authored
Merge pull request #2109 from leonardomoreira00/bug/fix-oom-systemd-annotation
cgroup: fix memory issue when resizing array of strings
2 parents fe55c27 + 8d9551f commit d17fd87

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/libcrun/cgroup-systemd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ append_systemd_annotation (sd_bus_message *m, const char *name, size_t name_len,
671671
if (n_parts == parts_size - 1)
672672
{
673673
parts_size += 32;
674-
parts = xrealloc (parts, parts_size);
674+
parts = xrealloc (parts, sizeof (char *) * parts_size);
675675
}
676676
parts[n_parts] = NULL;
677677
if (next == NULL)

0 commit comments

Comments
 (0)