Fix: handle leak in abi tests
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 May 2021 12:40:17 +0000 (08:40 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 May 2021 14:07:00 +0000 (10:07 -0400)
commitdbbb73968ec9af48c2b0b9ea65a4b03843109f7d
treed26be69123737326406a97c693bbb5af8cb0955d
parentc117e9884c3acc65408d8f65b2cd86a8511df1cc
Fix: handle leak in abi tests

Coverity finds that dlopen_ust leaks handles. Modify the code structure
to keep track of those handles in library descriptors so they are not
leaked.

*** CID 1453155:    (RESOURCE_LEAK)
/tests/regression/abi0-conflict/app_ust_dlopen.c: 35 in dlopen_ust()
29                     printf("Error: dlopen of liblttng-ust shared library (%s).\n", lib_soname);
30                     ret = EXIT_FAILURE;
31             } else {
32                     printf("Success: dlopen of liblttng-ust shared library (%s).\n", lib_soname);
33             }
34
>>>     CID 1453155:    (RESOURCE_LEAK)
>>>     Variable "handle" going out of scope leaks the storage it points to.
35             return ret;
36     }
37
38     static
39     int dlopen_abi0(void)
40     {
/tests/regression/abi0-conflict/app_noust_dlopen.c: 31 in dlopen_ust()
25                     printf("Error: dlopen of liblttng-ust shared library (%s).\n", lib_soname);
26                     ret = EXIT_FAILURE;
27             } else {
28                     printf("Success: dlopen of liblttng-ust shared library (%s).\n", lib_soname);
29             }
30
>>>     CID 1453155:    (RESOURCE_LEAK)
>>>     Variable "handle" going out of scope leaks the storage it points to.
31             return ret;
32     }
33
34     static
35     int dlopen_abi0(void)
36     {

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I967c2e8741c6d42c0c12e19fbadc81e1c91d1e0f
tests/regression/abi0-conflict/app_noust_dlopen.c
tests/regression/abi0-conflict/app_ust_dlopen.c
This page took 0.024691 seconds and 4 git commands to generate.