use after free
authorChristian Grothoff <christian@grothoff.org>
Fri, 14 Oct 2011 09:39:11 +0000 (09:39 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 14 Oct 2011 09:39:11 +0000 (09:39 +0000)
src/ats/ats_api_performance.c

index 8444658f3b69f858c63ecf9079ea2b679a778136..845fe2117a67b264abbb586c43abf62077ebf9da 100644 (file)
@@ -346,10 +346,13 @@ process_rr_message (struct GNUNET_ATS_PerformanceHandle *ph,
     GNUNET_free (rc);
     return GNUNET_OK;
   }
-  GNUNET_free (rc);
   /* amount non-zero, but client cancelled, consider undo! */
   if (GNUNET_YES != rc->undo)
+  {
+    GNUNET_free (rc);
     return GNUNET_OK; /* do not try to undo failed undos or negative amounts */
+  }
+  GNUNET_free (rc);
   (void) GNUNET_ATS_reserve_bandwidth (ph, &rr->peer, -amount, NULL, NULL);
   return GNUNET_OK;
 }