]> granicus.if.org Git - esp-idf/commitdiff
mbedtls: Re-apply ECP memory leak fix
authorAngus Gratton <angus@espressif.com>
Wed, 6 Sep 2017 05:07:17 +0000 (15:07 +1000)
committerAngus Gratton <gus@projectgus.com>
Thu, 7 Sep 2017 08:02:26 +0000 (18:02 +1000)
Fix not yet submitted upstream.

(Previously applied in ffefeef5ea271735884d656afac7a4155a57c87f)

components/mbedtls/library/ecp.c

index 5ad68639874fa3dcbaebdd368d26cea6dd09b045..a9705388cb62ec325bd4d0f78346f632c2290843 100644 (file)
@@ -1448,7 +1448,7 @@ static int ecp_mul_comb( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
 
 cleanup:
 
-    if( T != NULL && ! p_eq_g )
+    if( T != NULL && T != grp->T )
     {
         for( i = 0; i < pre_len; i++ )
             mbedtls_ecp_point_free( &T[i] );