[PATCH] gapk[master]: libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Mon Jan 8 17:48:38 UTC 2018


Review at  https://gerrit.osmocom.org/5687

libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit()

During the HR codec initialization, a part of the state is
allocated, but not freed at exit. Let's fix this.

Found during debugging with Valgrind:

4,932 bytes in 1 blocks are definitely lost in loss record 177 of 179
at 0x4C2AB80: malloc (in vgpreload_memcheck-amd64-linux.so)
by 0x6381C8F: gsmhr_init (libgsmhr.c:63)
by 0x526DF62: osmo_gapk_pq_queue_codec (pq_codec.c:48)
by 0x401ACE: make_processing_chain (app_osmo_gapk.c:573)
by 0x401ACE: main (app_osmo_gapk.c:765)

Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834
---
M libgsmhr/libgsmhr.c
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/87/5687/1

diff --git a/libgsmhr/libgsmhr.c b/libgsmhr/libgsmhr.c
index eca0ce0..305bbb6 100644
--- a/libgsmhr/libgsmhr.c
+++ b/libgsmhr/libgsmhr.c
@@ -79,6 +79,7 @@
 EXPORT void
 gsmhr_exit(struct gsmhr *state)
 {
+	free(state->bss_save);
 	free(state);
 }
 

-- 
To view, visit https://gerrit.osmocom.org/5687
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834
Gerrit-PatchSet: 1
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list