On Sat, May 05, 2012 at 01:27:27 +0200, Sven Eckelmann wrote:
We must be sure that there was no error during the creation of the hash before we can set the hash lock class. The class set function was added to the wrong place in 2c9aa3b4c37bd55148f5f25212c89e7bf5f28497
Signed-off-by: Sven Eckelmann sven@narfation.org
bridge_loop_avoidance.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c index 8bb274b..48831c2 100644 --- a/bridge_loop_avoidance.c +++ b/bridge_loop_avoidance.c @@ -1169,13 +1169,13 @@ int bla_init(struct bat_priv *bat_priv) bat_priv->claim_hash = hash_new(128); bat_priv->backbone_hash = hash_new(32);
- if (!bat_priv->claim_hash || !bat_priv->backbone_hash)
return -1;
if one hash_new succeeds and and the other fails, should we free the allocated structure before returning?
Cheers,