Project

General

Profile

Actions

Bug #136

closed

check hash_add fail

Added by Simon Wunderlich over 14 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

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)

Actions #1

Updated by Anonymous about 13 years ago

  • Category set to 2
  • Assignee deleted (Anonymous)
Actions #2

Updated by Anonymous almost 13 years ago

  • 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.

Actions #3

Updated by Simon Wunderlich over 12 years ago

it is not yet checked everywhere - we miss the check in translation-table.c at two points.

Actions #4

Updated by Antonio Quartulli almost 12 years ago

  • % Done changed from 70 to 90

After Simon's commit c2e935f5da562f008f77bb12995ebc10705cb15a also the two hash_add() invocations in translation-table.c are now checked.

Actions #5

Updated by Simon Wunderlich almost 12 years ago

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()

Actions #6

Updated by Simon Wunderlich almost 12 years ago

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?

Actions #7

Updated by Simon Wunderlich almost 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 90 to 100
Actions #8

Updated by Simon Wunderlich over 11 years ago

  • Status changed from Resolved to Closed
Actions #9

Updated by Sven Eckelmann about 7 years ago

  • Target version set to 2012.0.0
Actions

Also available in: Atom PDF