]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gprofng: fix a memory leak in the mxv-pthreads example
authorRuud van der Pas <ruud.vanderpas@oracle.com>
Wed, 16 Oct 2024 16:12:06 +0000 (16:12 +0000)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Fri, 18 Oct 2024 03:20:23 +0000 (20:20 -0700)
commitd6a07eeabbadbf846da7d6841340fc589d9a57aa
tree4c9a2317b750bfe4324e96c65ce87eb1dcd7a2f0
parent0e15fd3d54f8e70015f31226eaa87f9eaa536fbd
gprofng: fix a memory leak in the mxv-pthreads example

Fix a bug where the main program does not free the rows of
the matrix. The memory for thread_data_arguments is also
not released. In function check_results, the memory for the
marker vector is not released.
The usage of the verbose veriable has been extended to
print more messages.

gprofng/ChangeLog
2024-10-16  Ruud van der Pas  <ruud.vanderpas@oracle.com>

PR 32273
PR 32274
* mxv-pthreads/src/main.c: add calls to free() to
release the memory allocated for array A and vector
marker. Improve the usage of the verbose variable.
* mxv-pthreads/src/manage_data.c: add a diagnostic
printf statement.
* mxv-pthreads/src/mydefs.h: adapt prototype to
match the changes in main.c.
gprofng/examples/mxv-pthreads/src/main.c
gprofng/examples/mxv-pthreads/src/manage_data.c
gprofng/examples/mxv-pthreads/src/mydefs.h