From: psyc://loupsycedyglgamf.onion/~lynX Date: Tue, 30 Jan 2018 11:50:56 +0000 (+0000) Subject: -code scanner complains about intentional malloc return X-Git-Tag: v0.11.0pre66~225 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b3fdd5716f3e0622508e68450516d11a6d55a0ab;p=oweals%2Fgnunet.git -code scanner complains about intentional malloc return --- diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c index 31e3a3dc2..21158acd5 100644 --- a/src/social/gnunet-service-social.c +++ b/src/social/gnunet-service-social.c @@ -1774,12 +1774,13 @@ guest_enter (const struct GuestEnterRequest *greq, struct Guest **ret_gst) plc_gst, gst); - new_guest = GNUNET_NO; if (NULL == gst) { gst = GNUNET_new (struct Guest); new_guest = GNUNET_YES; } + else new_guest = GNUNET_NO; + if (NULL == gst->slave) { gst->origin = greq->origin; @@ -1878,7 +1879,7 @@ guest_enter (const struct GuestEnterRequest *greq, struct Guest **ret_gst) ret = GNUNET_YES; } - // TODO: explain why free(gst) not necessary + // TODO: explain to automatic code scanners why free(gst) not necessary if (NULL != ret_gst) *ret_gst = gst; return ret;