From 2483dd13894dac0da2d62276d38db27e811f9af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Wed, 21 Feb 2007 08:14:22 +0000 Subject: [PATCH] Fix a bug with the release of section's raw data. Both release loops were using translated data linked list, leading to a memory leak. Jkoshy's testsuite was used to check for non-regression. --- lib/libelf/libelf_allocate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libelf/libelf_allocate.c b/lib/libelf/libelf_allocate.c index 834e0ddf4a4..1fa1eee18a9 100644 --- a/lib/libelf/libelf_allocate.c +++ b/lib/libelf/libelf_allocate.c @@ -191,7 +191,7 @@ _libelf_release_scn(Elf_Scn *s) d = _libelf_release_data(d); } - STAILQ_FOREACH_SAFE(d, &s->s_data, d_next, td) { + STAILQ_FOREACH_SAFE(d, &s->s_rawdata, d_next, td) { assert((d->d_flags & LIBELF_F_MALLOCED) == 0); STAILQ_REMOVE(&s->s_rawdata, d, _Elf_Data, d_next); d = _libelf_release_data(d);