[lxc-devel] [lxc/lxc] 4cd72b: tests: fix a memory leak in lxcpath

Christian Brauner noreply at github.com
Tue Apr 13 12:32:35 UTC 2021


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

  Changed paths:
    M src/tests/lxcpath.c

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

```
$ sudo ./src/tests/lxc-test-lxcpath

=================================================================
==95911==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 39 byte(s) in 1 object(s) allocated from:
    #0 0x7effafc8d3dd in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x963dd)
    #1 0x7effaf5a2de6 in lxcapi_config_file_name /home/vagrant/lxc/src/lxc/lxccontainer.c:3190
    #2 0x562961680c30 in main /home/vagrant/lxc/src/tests/lxcpath.c:49
    #3 0x7effae5150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

Direct leak of 21 byte(s) in 1 object(s) allocated from:
    #0 0x7effafc8d3dd in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x963dd)
    #1 0x7effaf5a2de6 in lxcapi_config_file_name /home/vagrant/lxc/src/lxc/lxccontainer.c:3190
    #2 0x56296168115e in main /home/vagrant/lxc/src/tests/lxcpath.c:77
    #3 0x7effae5150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

Direct leak of 21 byte(s) in 1 object(s) allocated from:
    #0 0x7effafc8d3dd in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x963dd)
    #1 0x7effaf5a2de6 in lxcapi_config_file_name /home/vagrant/lxc/src/lxc/lxccontainer.c:3190
    #2 0x562961680f0a in main /home/vagrant/lxc/src/tests/lxcpath.c:63
    #3 0x7effae5150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

SUMMARY: AddressSanitizer: 81 byte(s) leaked in 3 allocation(s).
```

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


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

  Changed paths:
    M src/tests/lxcpath.c

  Log Message:
  -----------
  Merge pull request #3781 from evverx/lxcpath-memleak

tests: fix a memory leak in lxcpath


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


More information about the lxc-devel mailing list