Project

General

Profile

Bug #136

check hash_add fail

Added by Simon Wunderlich over 11 years ago. Updated over 4 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)

History

#1

Updated by Anonymous over 10 years ago

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

Updated by Anonymous about 10 years ago

  • % Done changed from 0 to 70
  • Assignee set to Simon Wunderlich

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.

#3

Updated by Simon Wunderlich over 9 years ago

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

#4

Updated by Antonio Quartulli about 9 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.

#5

Updated by Simon Wunderlich about 9 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()

#6

Updated by Simon Wunderlich about 9 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?

#7

Updated by Simon Wunderlich about 9 years ago

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

Updated by Simon Wunderlich almost 9 years ago

  • Status changed from Resolved to Closed
#9

Updated by Sven Eckelmann over 4 years ago

  • Target version set to 2012.0.0

Also available in: Atom PDF