Fix memory leak in example programs

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index 228e7f8..88c9f8c 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -2593,6 +2593,7 @@
                                                  opt.exp_label, strlen(opt.exp_label),
                                                  NULL, 0, 0);
         if (ret != 0) {
+            mbedtls_free(exported_key);
             goto exit;
         }
         mbedtls_printf("Exporting key of length %d with label \"%s\": 0x",
@@ -2603,6 +2604,7 @@
         }
         mbedtls_printf("\n\n");
         fflush(stdout);
+        mbedtls_free(exported_key);
     }
 #endif /* defined(MBEDTLS_SSL_KEYING_MATERIAL_EXPORT) */