gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29152 - in gnunet/src: identity include


From: gnunet
Subject: [GNUnet-SVN] r29152 - in gnunet/src: identity include
Date: Tue, 10 Sep 2013 12:54:28 +0200

Author: grothoff
Date: 2013-09-10 12:54:28 +0200 (Tue, 10 Sep 2013)
New Revision: 29152

Modified:
   gnunet/src/identity/identity_api.c
   gnunet/src/include/gnunet_identity_service.h
Log:
-do not crash if cb was NULL on ego free

Modified: gnunet/src/identity/identity_api.c
===================================================================
--- gnunet/src/identity/identity_api.c  2013-09-10 10:50:24 UTC (rev 29151)
+++ gnunet/src/identity/identity_api.c  2013-09-10 10:54:28 UTC (rev 29152)
@@ -172,6 +172,8 @@
 
 /**
  * Obtain the ego representing 'anonymous' users.
+ * 
+ * @return handle for the anonymous user, must not be freed
  */
 const struct GNUNET_IDENTITY_Ego *
 GNUNET_IDENTITY_ego_get_anonymous ()
@@ -448,8 +450,8 @@
 /**
  * Transmit next message to service.
  *
- * @param cls the 'struct GNUNET_IDENTITY_Handle'.
- * @param size number of bytes available in buf
+ * @param cls the `struct GNUNET_IDENTITY_Handle`.
+ * @param size number of bytes available in @a buf
  * @param buf where to copy the message
  * @return number of bytes copied to buf
  */
@@ -558,7 +560,7 @@
  *
  * @param cfg the configuration to use
  * @param cb function to call on all identity events, can be NULL
- * @param cb_cls closure for 'cb'
+ * @param cb_cls closure for @a cb
  * @return handle to use
  */
 struct GNUNET_IDENTITY_Handle *
@@ -614,7 +616,7 @@
  * @param id identity service to query
  * @param service_name for which service is an identity wanted
  * @param cb function to call with the result (will only be called once)
- * @param cb_cls closure for cb
+ * @param cb_cls closure for @a cb
  * @return handle to abort the operation
  */
 struct GNUNET_IDENTITY_Operation *
@@ -663,7 +665,7 @@
  * @param service_name for which service is an identity set
  * @param ego new default identity to be set for this service
  * @param cont function to call once the operation finished
- * @param cont_cls closure for cont
+ * @param cont_cls closure for @a cont
  * @return handle to abort the operation
  */
 struct GNUNET_IDENTITY_Operation *
@@ -713,7 +715,7 @@
  * @param id identity service to use
  * @param name desired name
  * @param cont function to call with the result (will only be called once)
- * @param cont_cls closure for cont
+ * @param cont_cls closure for @a cont
  * @return handle to abort the operation
  */
 struct GNUNET_IDENTITY_Operation *
@@ -768,7 +770,7 @@
  * @param old_name old name
  * @param new_name desired new name
  * @param cb function to call with the result (will only be called once)
- * @param cb_cls closure for cb
+ * @param cb_cls closure for @a cb
  * @return handle to abort the operation
  */
 struct GNUNET_IDENTITY_Operation *
@@ -923,10 +925,11 @@
   struct GNUNET_IDENTITY_Handle *h = cls;
   struct GNUNET_IDENTITY_Ego *ego = value;
 
-  h->cb (h->cb_cls,
-        ego,
-        &ego->ctx,
-        NULL);
+  if (NULL != h->cb)
+    h->cb (h->cb_cls,
+          ego,
+          &ego->ctx,
+          NULL);
   GNUNET_free (ego->pk);
   GNUNET_free (ego->name);
   GNUNET_free (ego);

Modified: gnunet/src/include/gnunet_identity_service.h
===================================================================
--- gnunet/src/include/gnunet_identity_service.h        2013-09-10 10:50:24 UTC 
(rev 29151)
+++ gnunet/src/include/gnunet_identity_service.h        2013-09-10 10:54:28 UTC 
(rev 29152)
@@ -83,7 +83,7 @@
 /**
  * Obtain the ego representing 'anonymous' users.
  *
- * @returns handle for the anonymous user, must not be freed
+ * @return handle for the anonymous user, must not be freed
  */
 const struct GNUNET_IDENTITY_Ego *
 GNUNET_IDENTITY_ego_get_anonymous (void);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]