Bug #136
closed
Added by Simon Wunderlich almost 15 years ago.
Updated almost 8 years ago.
Description
if hash_add fails (e.g. because kmalloc() for the bucket fails), references to data to be hashed may be lost. This might lead to memory leaks. There are still some cases for this behaviour, e.g. in translation-table.c (current revision: r1518)
- Category set to 2
- Assignee deleted (
Anonymous)
- Assignee set to Simon Wunderlich
- % Done changed from 0 to 70
hash_add now doesn't allocate memory anymore. Thus it is not possible to leak memory in that function after commit:4c4236064501e85915087f00a370df8d9f43028d - but the function still may fail and we have to check that in the calling function.
it is not yet checked everywhere - we miss the check in translation-table.c at two points.
- % Done changed from 70 to 90
After Simon's commit c2e935f5da562f008f77bb12995ebc10705cb15a also the two hash_add() invocations in translation-table.c are now checked.
nice. as far as I see, what we don't handle yet ist:
- out of memory in originator.c / batadv_orig_hash_add_if() - we leave orig table in bad shape, also the return code is never checked.
Apart from that, I can't find any other unchecked usages of batadv_hash_add()
Simon Wunderlich wrote:
nice. as far as I see, what we don't handle yet ist:
- out of memory in originator.c / batadv_orig_hash_add_if() - we leave orig table in bad shape, also the return code is never checked.
Apart from that, I can't find any other unchecked usages of batadv_hash_add()
well, I've just sent a patch for that (although it is not completely related, it just coincides to have hash_add in the name).
@Antonio, @Sven, I'd suggest to close the ticket now?
- Status changed from New to Resolved
- % Done changed from 90 to 100
- Status changed from Resolved to Closed
- Target version set to 2012.0.0
Also available in: Atom
PDF