Commit 63a65d16 authored by Dr. Matthias St. Pierre's avatar Dr. Matthias St. Pierre
Browse files

DRBG: fix memory leak on error in rand_drbg_get_entropy()

parent 55bd917b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
             */
            RANDerr(RAND_F_RAND_DRBG_GET_ENTROPY,
                    RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED);
            return 0;
            goto err;
        }

        /* Get entropy by polling system entropy sources. */
@@ -241,6 +241,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
        *pout = rand_pool_detach(pool);
    }

 err:
    rand_pool_free(pool);
    return ret;
}