-enable resetting client context to NULL
authorChristian Grothoff <christian@grothoff.org>
Thu, 15 Aug 2013 12:13:47 +0000 (12:13 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 15 Aug 2013 12:13:47 +0000 (12:13 +0000)
src/util/server.c

index 05463e1cb33391190e8ea82491db9798ad26b23a..11c6021c562dfb66a81824df99449e859662877e 100644 (file)
@@ -373,6 +373,12 @@ GNUNET_SERVER_client_set_user_context_ (struct GNUNET_SERVER_Client *client,
                                        void *ptr,
                                        size_t size)
 {
+  if (NULL == ptr)
+  {
+    client->user_context_size = 0;
+    client->user_context = ptr;
+    return;
+  }
   client->user_context_size = size;
   client->user_context = ptr;
 }