-fixing leaks/use after free
authorChristian Grothoff <christian@grothoff.org>
Thu, 8 Mar 2012 18:17:41 +0000 (18:17 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 8 Mar 2012 18:17:41 +0000 (18:17 +0000)
src/arm/arm_api.c
src/gns/test_gns_dht_delegated_lookup.c
src/util/crypto_rsa.c

index 16de889299b53ca9b52bed167ae892afff21d3ec..452dd34c4edd67190318fa86ff9101c3b67183db 100644 (file)
@@ -763,8 +763,8 @@ handle_list_response (void *cls, const struct GNUNET_MessageHeader *msg)
       if (NULL == end)
       {
        GNUNET_break (0);
-       GNUNET_free (sc);
        sc->callback (sc->cls, GNUNET_NO, 0, NULL);
+       GNUNET_free (sc);
        return;
       }
       list[i] = pos;
index 83fdf18730b0de924d32a3d11c3133a06e3430fa..3b097a3d52c3b706042e720721dcd842e073a8d9 100644 (file)
@@ -224,6 +224,7 @@ put_dht(void *cls, int32_t success, const char *emsg)
   {
     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Record serialization failed!\n");
     ok = 3;
+    GNUNET_free (nrb);
     return;
   }
   GNUNET_CRYPTO_hash(TEST_RECORD_NAME, strlen(TEST_RECORD_NAME), &name_hash);
@@ -244,6 +245,7 @@ put_dht(void *cls, int32_t success, const char *emsg)
                   DHT_OPERATION_TIMEOUT,
                   NULL,
                   NULL);
+  GNUNET_free (nrb);
   GNUNET_SCHEDULER_add_delayed(TIMEOUT, &finish_testing, NULL);
 }
 
index 8f69e97fd13ab07b02c665a4ca49d16306847c38..2bb65f69b0e616520ed16d6418f86b53e9cbce99 100644 (file)
@@ -808,6 +808,7 @@ GNUNET_CRYPTO_setup_hostkey (const char *cfg_name)
     pk = GNUNET_CRYPTO_rsa_key_create_from_file (fn);
     if (NULL != pk)
       GNUNET_CRYPTO_rsa_key_free (pk);
+    GNUNET_free (fn);
   }
   GNUNET_CONFIGURATION_destroy (cfg);
 }