Skip to contentSkip to conversation

tabled: fix a crash when looking up non-existing NID

PATCH Applied Pete Zaitcev 2 participants 2 messages Mar 29, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tabled: fix a crash when looking up non-existing NID

---
 server/storage.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
server/storage.c +2 -1
index 29e2435..913ef33 100644
@@ -406,7 +406,8 @@ struct storage_node *stor_node_by_nid(uint32_t nid)
 
 	g_mutex_lock(tabled_srv.bigmutex);
 	sn = _stor_node_by_nid(nid);
-	stor_node_get(sn);
+	if (sn)
+		stor_node_get(sn);
 	g_mutex_unlock(tabled_srv.bigmutex);
 	return sn;
 }