Just try to delete the Pos, if we realy found the entry.
[citadel.git] / citadel / file_ops.c
index 9040c4c746b4d009ba5cad19ebc91644be48c1b3..69e49c45e9625c9a543128ca45fbe87f8d862fd6 100644 (file)
@@ -70,9 +70,8 @@ int network_talking_to(const char *nodename, long len, int operation) {
                            (GetCount(nttlist) == 0))
                                break;
                        Pos = GetNewHashPos(nttlist, 1);
-                       GetHashPosFromKey (nttlist, nodename, len, Pos);
-
-                       DeleteEntryFromHash(nttlist, Pos);
+                       if (GetHashPosFromKey (nttlist, nodename, len, Pos))
+                               DeleteEntryFromHash(nttlist, Pos);
                        DeleteHashPos(&Pos);
                        syslog(LOG_DEBUG, "nttlist: removed <%s>\n", nodename);