[lxc-devel] [lxc/lxc] 5a9fae: tests: fix a memory leak in cgpath

Christian Brauner noreply at github.com
Tue Apr 13 12:14:46 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 5a9fae9e7f2177f374d0d842a63bd134a4eeb943
      https://github.com/lxc/lxc/commit/5a9fae9e7f2177f374d0d842a63bd134a4eeb943
  Author: Evgeny Vereshchagin <evvers at ya.ru>
  Date:   2021-04-10 (Sat, 10 Apr 2021)

  Changed paths:
    M src/tests/cgpath.c

  Log Message:
  -----------
  tests: fix a memory leak in cgpath

```
$ sudo ./src/tests/lxc-test-cgpath
Container creation tests...Passed
Container creation with LXCPATH tests...Passed

=================================================================
==57206==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 296 byte(s) in 1 object(s) allocated from:
    #0 0x7fef22c27dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6)
    #1 0x557c6e3ce3d9 in cgroup_ops_init cgroups/cgfsng.c:3347
    #2 0x557c6e3d6516 in cgroup_init cgroups/cgroup.c:33
    #3 0x557c6e3788e2 in test_running_container /home/vagrant/lxc/src/tests/cgpath.c:102
    #4 0x557c6e379c69 in test_container /home/vagrant/lxc/src/tests/cgpath.c:197
    #5 0x557c6e379e37 in main /home/vagrant/lxc/src/tests/cgpath.c:233
    #6 0x7fef2136c0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

Direct leak of 296 byte(s) in 1 object(s) allocated from:
    #0 0x7fef22c27dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6)
    #1 0x557c6e3ce3d9 in cgroup_ops_init cgroups/cgfsng.c:3347
    #2 0x557c6e3d6516 in cgroup_init cgroups/cgroup.c:33
    #3 0x557c6e3788e2 in test_running_container /home/vagrant/lxc/src/tests/cgpath.c:102
    #4 0x557c6e379c69 in test_container /home/vagrant/lxc/src/tests/cgpath.c:197
    #5 0x557c6e379e61 in main /home/vagrant/lxc/src/tests/cgpath.c:237
    #6 0x7fef2136c0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
```

Signed-off-by: Evgeny Vereshchagin <evvers at ya.ru>


  Commit: 274615f9e3f2bbb0e2b7a9c007b6dcd54169404f
      https://github.com/lxc/lxc/commit/274615f9e3f2bbb0e2b7a9c007b6dcd54169404f
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2021-04-13 (Tue, 13 Apr 2021)

  Changed paths:
    M src/tests/cgpath.c

  Log Message:
  -----------
  Merge pull request #3780 from evverx/cgpath-mem-leak

tests: fix a memory leak in cgpath


Compare: https://github.com/lxc/lxc/compare/aeff7df6e44d...274615f9e3f2


More information about the lxc-devel mailing list