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.
This commit is contained in:
Jean-Sébastien Pédron 2007-02-21 08:14:22 +00:00
parent 814ee007c3
commit 2483dd1389

View File

@ -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);