aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2013-09-16 12:37:16 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2013-09-16 12:37:16 +0000
commitb7970fe9e1e4c0321989a6632f21629d5d82a6cc (patch)
tree7a5d0e85add42a5470d24f17aa4326ffe1b043f2
parent8cabb2185f100d779e6ac16a57315ca3e6713d30 (diff)
downloadgnunet-b7970fe9e1e4c0321989a6632f21629d5d82a6cc.tar.gz
gnunet-b7970fe9e1e4c0321989a6632f21629d5d82a6cc.zip
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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/scalarproduct/scalarproduct_api.c b/src/scalarproduct/scalarproduct_api.c
index fc470eb20..a6d32f9ab 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)
502 if (qe == h) 502 if (qe == h)
503 { 503 {
504 GNUNET_CONTAINER_DLL_remove (head, tail, qe); 504 GNUNET_CONTAINER_DLL_remove (head, tail, qe);
505 if (NULL == qe->th) 505 if (NULL != qe->th)
506 GNUNET_CLIENT_notify_transmit_ready_cancel (qe->th); 506 GNUNET_CLIENT_notify_transmit_ready_cancel (qe->th);
507 GNUNET_CLIENT_disconnect (qe->client); 507 GNUNET_CLIENT_disconnect (qe->client);
508 GNUNET_STATISTICS_destroy (qe->stats, GNUNET_YES); 508 GNUNET_STATISTICS_destroy (qe->stats, GNUNET_YES);
509 GNUNET_free (qe->msg); 509 GNUNET_free_non_null (qe->msg);
510 GNUNET_free (qe); 510 GNUNET_free (qe);
511 break; 511 break;
512 } 512 }
@@ -525,11 +525,11 @@ GNUNET_SCALARPRODUCT_disconnect ()
525 for (qe = head; head != NULL; qe = head) 525 for (qe = head; head != NULL; qe = head)
526 { 526 {
527 GNUNET_CONTAINER_DLL_remove (head, tail, qe); 527 GNUNET_CONTAINER_DLL_remove (head, tail, qe);
528 if (NULL == qe->th) 528 if (NULL != qe->th)
529 GNUNET_CLIENT_notify_transmit_ready_cancel (qe->th); 529 GNUNET_CLIENT_notify_transmit_ready_cancel (qe->th);
530 GNUNET_CLIENT_disconnect (qe->client); 530 GNUNET_CLIENT_disconnect (qe->client);
531 GNUNET_STATISTICS_destroy (qe->stats, GNUNET_YES); 531 GNUNET_STATISTICS_destroy (qe->stats, GNUNET_YES);
532 GNUNET_free (qe->msg); 532 GNUNET_free_non_null (qe->msg);
533 GNUNET_free (qe); 533 GNUNET_free (qe);
534 } 534 }
535} 535}