aboutsummaryrefslogtreecommitdiff
path: root/src/social/social_api.c
diff options
context:
space:
mode:
authorCarlo von lynX <lynX@time.to.get.psyced.org>2016-07-28 00:22:43 +0000
committerCarlo von lynX <lynX@time.to.get.psyced.org>2016-07-28 00:22:43 +0000
commit00da479663f9b8af36a89e6643fed03f4256ce28 (patch)
tree12156185c781a24ce5081700c1cd92de14a69cc2 /src/social/social_api.c
parent46b723ebd22301be02cfbca34c471f9397f163c5 (diff)
downloadgnunet-00da479663f9b8af36a89e6643fed03f4256ce28.tar.gz
gnunet-00da479663f9b8af36a89e6643fed03f4256ce28.zip
social: leaks and untreated error conditions
Diffstat (limited to 'src/social/social_api.c')
-rw-r--r--src/social/social_api.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/social/social_api.c b/src/social/social_api.c
index c33f39dce..a7a4e9dcf 100644
--- a/src/social/social_api.c
+++ b/src/social/social_api.c
@@ -967,19 +967,21 @@ app_recv_place (void *cls,
967 967
968 if (GNUNET_YES == pmsg->is_host) 968 if (GNUNET_YES == pmsg->is_host)
969 { 969 {
970 struct GNUNET_SOCIAL_HostConnection *hconn = GNUNET_malloc (sizeof (*hconn)); 970 if (NULL != app->host_cb) {
971 hconn->app = app; 971 struct GNUNET_SOCIAL_HostConnection *hconn = GNUNET_malloc (sizeof (*hconn));
972 hconn->plc_msg = *pmsg; 972 hconn->app = app;
973 if (NULL != app->host_cb) 973 hconn->plc_msg = *pmsg;
974 app->host_cb (app->cb_cls, hconn, ego, &pmsg->place_pub_key, pmsg->place_state); 974 app->host_cb (app->cb_cls, hconn, ego, &pmsg->place_pub_key, pmsg->place_state);
975 // FIXME: should this have a GNUNET_free (hconn) here?
976 }
975 } 977 }
976 else 978 else if (NULL != app->guest_cb)
977 { 979 {
978 struct GNUNET_SOCIAL_GuestConnection *gconn = GNUNET_malloc (sizeof (*gconn)); 980 struct GNUNET_SOCIAL_GuestConnection *gconn = GNUNET_malloc (sizeof (*gconn));
979 gconn->app = app; 981 gconn->app = app;
980 gconn->plc_msg = *pmsg; 982 gconn->plc_msg = *pmsg;
981 if (NULL != app->guest_cb) 983 app->guest_cb (app->cb_cls, gconn, ego, &pmsg->place_pub_key, pmsg->place_state);
982 app->guest_cb (app->cb_cls, gconn, ego, &pmsg->place_pub_key, pmsg->place_state); 984 GNUNET_free (gconn); // FIXME: is this correct here?
983 } 985 }
984} 986}
985 987