diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-09-16 12:37:16 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-09-16 12:37:16 +0000 |
commit | b7970fe9e1e4c0321989a6632f21629d5d82a6cc (patch) | |
tree | 7a5d0e85add42a5470d24f17aa4326ffe1b043f2 | |
parent | 8cabb2185f100d779e6ac16a57315ca3e6713d30 (diff) |
fixed a possible free-of-null in the SP-API
modified if-clause to check for the opposite, correct condition
-rw-r--r-- | src/scalarproduct/scalarproduct_api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/scalarproduct/scalarproduct_api.c b/src/scalarproduct/scalarproduct_api.c index fc470eb20c..a6d32f9ab7 100644 --- a/src/scalarproduct/scalarproduct_api.c +++ b/src/scalarproduct/scalarproduct_api.c @@ -502,11 +502,11 @@ GNUNET_SCALARPRODUCT_cancel (struct GNUNET_SCALARPRODUCT_ComputationHandle * h) if (qe == h) { GNUNET_CONTAINER_DLL_remove (head, tail, qe); - if (NULL == qe->th) + if (NULL != qe->th) GNUNET_CLIENT_notify_transmit_ready_cancel (qe->th); GNUNET_CLIENT_disconnect (qe->client); GNUNET_STATISTICS_destroy (qe->stats, GNUNET_YES); - GNUNET_free (qe->msg); + GNUNET_free_non_null (qe->msg); GNUNET_free (qe); break; } @@ -525,11 +525,11 @@ GNUNET_SCALARPRODUCT_disconnect () for (qe = head; head != NULL; qe = head) { GNUNET_CONTAINER_DLL_remove (head, tail, qe); - if (NULL == qe->th) + if (NULL != qe->th) GNUNET_CLIENT_notify_transmit_ready_cancel (qe->th); GNUNET_CLIENT_disconnect (qe->client); GNUNET_STATISTICS_destroy (qe->stats, GNUNET_YES); - GNUNET_free (qe->msg); + GNUNET_free_non_null (qe->msg); GNUNET_free (qe); } } |