fix DLL assertion
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Wed, 6 May 2020 18:02:15 +0000 (20:02 +0200)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Wed, 6 May 2020 18:02:15 +0000 (20:02 +0200)
src/reclaim/plugin_rest_openid_connect.c

index 9c474d527eaac94a6ed94490c23252ee3b4f0baa..ad8e373fec7e8059dcac0f28b3f35cf6f5c414ab 100644 (file)
@@ -2255,16 +2255,19 @@ list_ego (void *cls,
     for (ego_entry = handle->ego_head; NULL != ego_entry;
          ego_entry = ego_entry->next)
     {
-      if (ego_entry->ego != ego)
-        continue;
-      GNUNET_CONTAINER_DLL_remove (handle->ego_head,
-                                   handle->ego_tail,
-                                   ego_entry);
-      GNUNET_free (ego_entry->identifier);
-      GNUNET_free (ego_entry->keystring);
-      GNUNET_free (ego_entry);
-      return;
+      if (ego_entry->ego == ego)
+        break;
     }
+    if (NULL == ego_entry)
+      return; /* Not found */
+
+    GNUNET_CONTAINER_DLL_remove (handle->ego_head,
+                                 handle->ego_tail,
+                                 ego_entry);
+    GNUNET_free (ego_entry->identifier);
+    GNUNET_free (ego_entry->keystring);
+    GNUNET_free (ego_entry);
+    return;
   }
 }